Module: ThreadSafe::Util::CheapLockable

### Home Classes Methods

### In Files

- lib/thread_safe/util/cheap_lockable.rb

### Class/Module Index

Quicksearch

- ThreadSafe
- ThreadSafe::Array
- ThreadSafe::AtomicReferenceCacheBackend
- ThreadSafe::AtomicReferenceCacheBackend::Node
- ThreadSafe::AtomicReferenceCacheBackend::Table
- ThreadSafe::Cache
- ThreadSafe::Hash
- ThreadSafe::MriCacheBackend
- ThreadSafe::NonConcurrentCacheBackend
- ThreadSafe::SynchronizedCacheBackend
- ThreadSafe::Util
- ThreadSafe::Util::Adder
- ThreadSafe::Util::CheapLockable
- ThreadSafe::Util::PowerOfTwoTuple
- ThreadSafe::Util::Striped64
- ThreadSafe::Util::Striped64::Cell
- ThreadSafe::Util::Volatile
- ThreadSafe::Util::VolatileTuple
- SynchronizedDelegator
- Threadsafe

No matching classes.

# ThreadSafe::Util::CheapLockable

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.