Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/signals2/detail/unique_lock.hpp @ 133:4acb5d8d80b6 tip
Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author | Chris Cannam |
---|---|
date | Tue, 30 Jul 2019 12:25:44 +0100 |
parents | 2665513ce2d3 |
children |
rev | line source |
---|---|
Chris@16 | 1 /* |
Chris@16 | 2 Provides a basic subset of boost::unique_lock functionality. Provided only because |
Chris@16 | 3 including boost/thread/locks.hpp requires linking to thread library |
Chris@16 | 4 */ |
Chris@16 | 5 // Copyright Frank Mori Hess 2008. |
Chris@16 | 6 // Distributed under the Boost Software License, Version |
Chris@16 | 7 // 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
Chris@16 | 8 // http://www.boost.org/LICENSE_1_0.txt) |
Chris@16 | 9 |
Chris@16 | 10 // See http://www.boost.org/libs/signals2 for library home page. |
Chris@16 | 11 |
Chris@16 | 12 #ifndef BOOST_SIGNALS2_UNIQUE_LOCK_HPP |
Chris@16 | 13 #define BOOST_SIGNALS2_UNIQUE_LOCK_HPP |
Chris@16 | 14 |
Chris@16 | 15 #include <boost/noncopyable.hpp> |
Chris@16 | 16 |
Chris@16 | 17 namespace boost |
Chris@16 | 18 { |
Chris@16 | 19 namespace signals2 |
Chris@16 | 20 { |
Chris@16 | 21 namespace detail |
Chris@16 | 22 { |
Chris@16 | 23 template<typename Mutex> |
Chris@16 | 24 class unique_lock: public noncopyable |
Chris@16 | 25 { |
Chris@16 | 26 public: |
Chris@16 | 27 unique_lock(Mutex &m): _mutex(m) |
Chris@16 | 28 { |
Chris@16 | 29 _mutex.lock(); |
Chris@16 | 30 } |
Chris@16 | 31 ~unique_lock() |
Chris@16 | 32 { |
Chris@16 | 33 _mutex.unlock(); |
Chris@16 | 34 } |
Chris@16 | 35 private: |
Chris@16 | 36 Mutex &_mutex; |
Chris@16 | 37 }; |
Chris@16 | 38 } // namespace detail |
Chris@16 | 39 } // namespace signals2 |
Chris@16 | 40 } // namespace boost |
Chris@16 | 41 |
Chris@16 | 42 #endif // BOOST_SIGNALS2_UNIQUE_LOCK_HPP |