diff options
Diffstat (limited to '3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp b/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp index a2e6fd4..848864e 100644 --- a/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp +++ b/3rdParty/Boost/src/boost/asio/detail/scoped_lock.hpp @@ -2,7 +2,7 @@ // detail/scoped_lock.hpp // ~~~~~~~~~~~~~~~~~~~~~~ // -// Copyright (c) 2003-2012 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2014 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -29,8 +29,18 @@ class scoped_lock : private noncopyable { public: + // Tag type used to distinguish constructors. + enum adopt_lock_t { adopt_lock }; + + // Constructor adopts a lock that is already held. + scoped_lock(Mutex& m, adopt_lock_t) + : mutex_(m), + locked_(true) + { + } + // Constructor acquires the lock. - scoped_lock(Mutex& m) + explicit scoped_lock(Mutex& m) : mutex_(m) { mutex_.lock(); |