Lines Matching defs:rwl
46 pthread_rwlock_t rwl;
69 rwl = *rwlock;
71 if (rwl->nMagic != PTW32_RWLOCK_MAGIC)
76 if ((result = pthread_mutex_lock (&(rwl->mtxExclusiveAccess))) != 0)
81 if ((result = pthread_mutex_lock (&(rwl->mtxSharedAccessCompleted))) != 0)
83 (void) pthread_mutex_unlock (&(rwl->mtxExclusiveAccess));
87 if (rwl->nExclusiveAccessCount == 0)
89 if (rwl->nCompletedSharedAccessCount > 0)
91 rwl->nSharedAccessCount -= rwl->nCompletedSharedAccessCount;
92 rwl->nCompletedSharedAccessCount = 0;
95 if (rwl->nSharedAccessCount > 0)
97 rwl->nCompletedSharedAccessCount = -rwl->nSharedAccessCount;
106 pthread_cleanup_push (ptw32_rwlock_cancelwrwait, (void *) rwl);
110 result = pthread_cond_wait (&(rwl->cndSharedAccessCompleted),
111 &(rwl->mtxSharedAccessCompleted));
113 while (result == 0 && rwl->nCompletedSharedAccessCount < 0);
122 rwl->nSharedAccessCount = 0;
129 rwl->nExclusiveAccessCount++;