123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #include <errno.h>
- #include "pthreadP.h"
- #include <lowlevellock.h>
- int
- __pthread_rwlock_trywrlock (
- pthread_rwlock_t *rwlock)
- {
- int result = EBUSY;
- lll_lock (rwlock->__data.__lock, rwlock->__data.__shared);
- if (rwlock->__data.__writer == 0 && rwlock->__data.__nr_readers == 0)
- {
- rwlock->__data.__writer = THREAD_GETMEM (THREAD_SELF, tid);
- result = 0;
- }
- lll_unlock (rwlock->__data.__lock, rwlock->__data.__shared);
- return result;
- }
- strong_alias (__pthread_rwlock_trywrlock, pthread_rwlock_trywrlock)
|