Sha256: 2bb88633dfc4be15193a7b8c8f576a83f5c04ed3d67b9bdbf1954d28184a3320
Contents?: true
Size: 609 Bytes
Versions: 11
Compression:
Stored size: 609 Bytes
Contents
#ifndef _PASSENGER_LOCK_H_ #define _PASSENGER_LOCK_H_ #include <boost/thread.hpp> namespace Passenger { using namespace boost; /** Shortcut typedefs. */ typedef boost::lock_guard<boost::mutex> LockGuard; typedef boost::unique_lock<boost::mutex> ScopedLock; /** Nicer syntax for conditionally locking the mutex during construction. */ class DynamicScopedLock: public unique_lock<boost::mutex> { public: DynamicScopedLock(boost::mutex &m, bool lockNow = true) : unique_lock<boost::mutex>(m, defer_lock) { if (lockNow) { lock(); } } }; } // namespace Passenger #endif /* _PASSENGER_LOCK_H_ */
Version data entries
11 entries across 11 versions & 1 rubygems