File:  [DVB] / dietlibc / libpthread / pthread_rwlock_rdlock.c
Revision 1.1: download - view: text, annotated - select for diffs
Sat Aug 27 17:35:13 2016 UTC (7 years, 9 months ago) by leitner
Branches: MAIN
CVS tags: HEAD
  add really crappy pthread_rwclock implementation for openssl 1.1

#include <sched.h>
#include <pthread.h>

int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock) {
  unsigned int n;
  for (n=0;;) {
    int r=pthread_rwlock_tryrdlock(rwlock);
    if (r==0) return r;
    if (n<100) {
      ++n;
      continue;
    }
    sched_yield();
  }
}

LinuxTV legacy CVS <linuxtv.org/cvs>