method
sync_lock
v1_9_3_392 -
Show latest stable
- Class:
Sync_m
sync_lock(m = EX)public
No documentation available.
# File lib/sync.rb, line 138
def sync_lock(m = EX)
return unlock if m == UN
while true
@sync_mutex.synchronize do
if sync_try_lock_sub(m)
return self
else
if sync_sh_locker[Thread.current]
sync_upgrade_waiting.push [Thread.current, sync_sh_locker[Thread.current]]
sync_sh_locker.delete(Thread.current)
else
sync_waiting.push Thread.current
end
@sync_mutex.sleep
end
end
end
self
end