A read/write lock.
TODO: I'm not yet sure how to implement this correctly, or how to test it.
initialize(readers = -1)
lock_read
lock_write
unlock_read
unlock_write
synchronize_read(*args)
synchronize_write(*args)
A wrapper around a read/write lock that has the same interface as a
Mutex and performs only read locks
Example:
rwlock = RWLock.new
read_lock = ReadLock.new(rwlock)
read_lock.synchronize do
# ...
end
initialize(obj)
lock
try_lock
unlock
synchronize(&block)
A wrapper around a read/write lock that has the same interface as a
Mutex and performs only write locks
initialize(obj)
lock
try_lock
unlock
synchronize(&block)
Requires
loaders
thread
semaphore
lock