Return to pthread_rwlock_wrlock.c CVS log | Up to [DVB] / dietlibc / libpthread |
add really crappy pthread_rwclock implementation for openssl 1.1
#include <sched.h> #include <pthread.h> int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock) { unsigned int n; for (n=0;;) { int r=pthread_rwlock_trywrlock(rwlock); if (r==0) return r; if (n<100) { ++n; continue; } sched_yield(); } }