Module | ThreadSafe::Util::CheapLockable |
In: |
lib/thread_safe/util/cheap_lockable.rb
|
Provides a cheapest possible (mainly in terms of memory usage) Mutex with the ConditionVariable bundled in.
Usage:
class A include CheapLockable def do_exlusively cheap_synchronize { yield } end def wait_for_something cheap_synchronize do cheap_wait until resource_available? do_something cheap_broadcast # wake up others end end end