mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-23 19:43:09 +00:00
bugfix: rwlock
This commit is contained in:
@@ -29,7 +29,7 @@ rwlock_rlock(struct rwlock *lock) {
|
||||
|
||||
static inline void
|
||||
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) {
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user