Sha256: b627bbb38d961797fa775e6964ad17631ab9fec4992f787070dcda78a066efa3
Contents?: true
Size: 595 Bytes
Versions: 9
Compression:
Stored size: 595 Bytes
Contents
#ifndef _PASSENGER_LOCK_H_ #define _PASSENGER_LOCK_H_ #include <boost/thread.hpp> namespace Passenger { using namespace boost; /** Shortcut typedefs. */ typedef lock_guard<boost::mutex> LockGuard; typedef 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
9 entries across 9 versions & 1 rubygems