mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
bugfix: rwlock
This commit is contained in:
@@ -29,7 +29,7 @@ rwlock_rlock(struct rwlock *lock) {
|
|||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
rwlock_wlock(struct rwlock *lock) {
|
rwlock_wlock(struct rwlock *lock) {
|
||||||
__sync_lock_test_and_set(&lock->write,1);
|
while (__sync_lock_test_and_set(&lock->write,1)) {}
|
||||||
while(lock->read) {
|
while(lock->read) {
|
||||||
__sync_synchronize();
|
__sync_synchronize();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user