version 1.42, 2020/06/02 00:29:53 |
version 1.43, 2022/02/11 21:40:58 |
Line 228 pthread__rwlock_rdlock(pthread_rwlock_t |
|
Line 228 pthread__rwlock_rdlock(pthread_rwlock_t |
|
|
|
/* Did we get the lock? */ |
/* Did we get the lock? */ |
if (self->pt_rwlocked == _RW_LOCKED) { |
if (self->pt_rwlocked == _RW_LOCKED) { |
#ifndef PTHREAD__ATOMIC_IS_MEMBAR |
|
membar_enter(); |
membar_enter(); |
#endif |
|
return 0; |
return 0; |
} |
} |
if (error != 0) |
if (error != 0) |
Line 352 pthread__rwlock_wrlock(pthread_rwlock_t |
|
Line 350 pthread__rwlock_wrlock(pthread_rwlock_t |
|
|
|
/* Did we get the lock? */ |
/* Did we get the lock? */ |
if (self->pt_rwlocked == _RW_LOCKED) { |
if (self->pt_rwlocked == _RW_LOCKED) { |
#ifndef PTHREAD__ATOMIC_IS_MEMBAR |
|
membar_enter(); |
membar_enter(); |
#endif |
|
return 0; |
return 0; |
} |
} |
if (error != 0) |
if (error != 0) |
Line 526 pthread_rwlock_unlock(pthread_rwlock_t * |
|
Line 522 pthread_rwlock_unlock(pthread_rwlock_t * |
|
* by the writer that we are about to wake. |
* by the writer that we are about to wake. |
*/ |
*/ |
(void)atomic_swap_ptr(&ptr->ptr_owner, (void *)new); |
(void)atomic_swap_ptr(&ptr->ptr_owner, (void *)new); |
|
#ifndef PTHREAD__ATOMIC_IS_MEMBAR |
|
membar_exit(); |
|
#endif |
|
|
/* Wake the writer. */ |
/* Wake the writer. */ |
thread->pt_rwlocked = _RW_LOCKED; |
thread->pt_rwlocked = _RW_LOCKED; |
Line 543 pthread_rwlock_unlock(pthread_rwlock_t * |
|
Line 542 pthread_rwlock_unlock(pthread_rwlock_t * |
|
if (thread->pt_sleepobj == NULL) |
if (thread->pt_sleepobj == NULL) |
continue; |
continue; |
new += RW_READ_INCR; |
new += RW_READ_INCR; |
|
membar_exit(); |
thread->pt_rwlocked = _RW_LOCKED; |
thread->pt_rwlocked = _RW_LOCKED; |
} |
} |
|
|