/
usr
/
include
/
boost
/
thread
/
/usr/include/boost/thread
mkdir
upload
Name
Size
Mode
Actions
concurrent_queues/
-
0755
rm
csbl/
-
0755
rm
detail/
-
0755
rm
executors/
-
0755
rm
experimental/
-
0755
rm
futures/
-
0755
rm
pthread/
-
0755
rm
v2/
-
0755
rm
win32/
-
0755
rm
barrier.hpp
7421
0644
edit
dl
rm
caller_context.hpp
1526
0644
edit
dl
rm
completion_latch.hpp
6579
0644
edit
dl
rm
condition.hpp
490
0644
edit
dl
rm
condition_variable.hpp
634
0644
edit
dl
rm
cv_status.hpp
531
0644
edit
dl
rm
exceptional_ptr.hpp
1098
0644
edit
dl
rm
exceptions.hpp
6286
0644
edit
dl
rm
executor.hpp
476
0644
edit
dl
rm
externally_locked.hpp
10792
0644
edit
dl
rm
externally_locked_stream.hpp
4784
0644
edit
dl
rm
future.hpp
203792
0644
edit
dl
rm
interruption.hpp
596
0644
edit
dl
rm
is_locked_by_this_thread.hpp
1062
0644
edit
dl
rm
latch.hpp
4967
0644
edit
dl
rm
lockable_adapter.hpp
6043
0644
edit
dl
rm
lockable_concepts.hpp
4114
0644
edit
dl
rm
lockable_traits.hpp
7853
0644
edit
dl
rm
locks.hpp
572
0644
edit
dl
rm
lock_algorithms.hpp
13201
0644
edit
dl
rm
lock_concepts.hpp
4792
0644
edit
dl
rm
lock_factories.hpp
2317
0644
edit
dl
rm
lock_guard.hpp
2290
0644
edit
dl
rm
lock_options.hpp
701
0644
edit
dl
rm
lock_traits.hpp
1234
0644
edit
dl
rm
lock_types.hpp
34418
0644
edit
dl
rm
mutex.hpp
1166
0644
edit
dl
rm
null_mutex.hpp
6346
0644
edit
dl
rm
once.hpp
1324
0644
edit
dl
rm
ostream_buffer.hpp
925
0644
edit
dl
rm
poly_lockable.hpp
2100
0644
edit
dl
rm
poly_lockable_adapter.hpp
2124
0644
edit
dl
rm
poly_shared_lockable.hpp
5807
0644
edit
dl
rm
poly_shared_lockable_adapter.hpp
4792
0644
edit
dl
rm
recursive_mutex.hpp
1535
0644
edit
dl
rm
reverse_lock.hpp
1316
0644
edit
dl
rm
scoped_thread.hpp
8547
0644
edit
dl
rm
shared_lock_guard.hpp
1192
0644
edit
dl
rm
shared_mutex.hpp
1400
0644
edit
dl
rm
strict_lock.hpp
6246
0644
edit
dl
rm
synchronized_value.hpp
31110
0644
edit
dl
rm
sync_bounded_queue.hpp
595
0644
edit
dl
rm
sync_queue.hpp
571
0644
edit
dl
rm
testable_mutex.hpp
3925
0644
edit
dl
rm
thread.hpp
385
0644
edit
dl
rm
thread_functors.hpp
1366
0644
edit
dl
rm
thread_guard.hpp
1069
0644
edit
dl
rm
thread_only.hpp
803
0644
edit
dl
rm
thread_pool.hpp
531
0644
edit
dl
rm
thread_time.hpp
1590
0644
edit
dl
rm
tss.hpp
2603
0644
edit
dl
rm
user_scheduler.hpp
5222
0644
edit
dl
rm
with_lock_guard.hpp
6052
0644
edit
dl
rm
xtime.hpp
2390
0644
edit
dl
rm
Edit:
/usr/include/boost/thread/strict_lock.hpp
(6246B)
// 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) // (C) Copyright 2008-2009,2012 Vicente J. Botet Escriba #ifndef BOOST_THREAD_STRICT_LOCK_HPP #define BOOST_THREAD_STRICT_LOCK_HPP #include <boost/thread/detail/config.hpp> #include <boost/thread/detail/delete.hpp> #include <boost/thread/detail/lockable_wrapper.hpp> #include <boost/thread/lock_options.hpp> #include <boost/thread/lock_traits.hpp> #include <boost/thread/lockable_traits.hpp> #include <boost/thread/lockable_concepts.hpp> #include <boost/thread/lock_concepts.hpp> #include <boost/thread/exceptions.hpp> #include <boost/throw_exception.hpp> #include <boost/config/abi_prefix.hpp> namespace boost { //[strict_lock template <typename Lockable> class strict_lock { BOOST_CONCEPT_ASSERT(( BasicLockable<Lockable> )); public: typedef Lockable mutex_type; // construct/copy/destroy: BOOST_THREAD_NO_COPYABLE( strict_lock) /** * Constructor from a mutex reference. * * @param mtx the mutex to lock. * * __Effects: Stores a reference to the mutex to lock and locks it. * __Throws: Any exception BasicMutex::lock() can throw. */ explicit strict_lock(mutex_type& mtx) : mtx_(mtx) { mtx.lock(); } /*< locks on construction >*/ #if ! defined BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST strict_lock(std::initializer_list<thread_detail::lockable_wrapper<Lockable> > l_) : mtx_(*(const_cast<thread_detail::lockable_wrapper<Lockable>*>(l_.begin())->m)) { mtx_.lock(); } #endif /** * Destructor * * __Effects: unlocks the stored mutex. * * __Throws */ ~strict_lock() { mtx_.unlock(); } /*< unlocks on destruction >*/ // observers /** * @return the owned mutex. */ mutex_type* mutex() const BOOST_NOEXCEPT { return &mtx_; } /** * @return whether this lock is locking a mutex. */ bool owns_lock() const BOOST_NOEXCEPT { return true; } /** * @return whether this lock is locking that mutex. */ bool owns_lock(const mutex_type* l) const BOOST_NOEXCEPT { return l == mutex(); } /*< strict locks specific function >*/ //BOOST_ADRESS_OF_DELETE(strict_lock) /*< disable aliasing >*/ //BOOST_HEAP_ALLOCATION_DELETE(strict_lock) /*< disable heap allocation >*/ /*< no possibility to unlock >*/ private: mutex_type& mtx_; }; //] template <typename Lockable> struct is_strict_lock_sur_parole<strict_lock<Lockable> > : true_type { }; /** * A nested strict lock is a scoped lock guard ensuring the mutex is locked on its * scope, by taking ownership of an nesting lock, locking the mutex on construction if not already locked * and restoring the ownership to the nesting lock on destruction. */ //[nested_strict_lock template <typename Lock> class nested_strict_lock { BOOST_CONCEPT_ASSERT(( BasicLock<Lock> )); /*< The Lock must be a movable lock >*/ public: typedef typename Lock::mutex_type mutex_type; /*< Name the lockable type locked by Lock >*/ BOOST_THREAD_NO_COPYABLE( nested_strict_lock) /** * Constructor from a nesting @c Lock. * * @param lk the nesting lock * * __Requires: <c>lk.mutex() != null_ptr</c> * __Effects: Stores the reference to the lock parameter and takes ownership on it. * If the lock doesn't owns the mutex @c mtx lock it. * __Postconditions: @c owns_lock(lk.mutex()) * __StrongException * __Throws: * * - lock_error when BOOST_THREAD_THROW_IF_PRECONDITION_NOT_SATISFIED is defined and lk.mutex() == null_ptr * * - Any exception that @c lk.lock() can throw. * */ explicit nested_strict_lock(Lock& lk) : lk_(lk) /*< Store reference to lk >*/ { /*< Define BOOST_THREAD_DONT_CHECK_PRECONDITIONS if you don't want to check lk ownership >*/ BOOST_THREAD_ASSERT_PRECONDITION( lk.mutex() != 0, lock_error() ); if (!lk.owns_lock()) lk.lock(); /*< ensures it is locked >*/ tmp_lk_ = move(lk); /*< Move ownership to temporary lk >*/ } #if ! defined BOOST_THREAD_NO_CXX11_HDR_INITIALIZER_LIST nested_strict_lock(std::initializer_list<thread_detail::lockable_wrapper<Lock> > l_) : lk_(*(const_cast<thread_detail::lockable_wrapper<Lock>*>(l_.begin())->m)) { /*< Define BOOST_THREAD_DONT_CHECK_PRECONDITIONS if you don't want to check lk ownership >*/ BOOST_THREAD_ASSERT_PRECONDITION( lk_.mutex() != 0, lock_error() ); if (!lk_.owns_lock()) lk_.lock(); /*< ensures it is locked >*/ tmp_lk_ = move(lk_); /*< Move ownership to temporary lk >*/ } #endif /** * Destructor * * __Effects: Restores ownership to the nesting lock. */ ~nested_strict_lock()BOOST_NOEXCEPT { lk_ = move(tmp_lk_); /*< Move ownership to nesting lock >*/ } // observers /** * return @c the owned mutex. */ mutex_type* mutex() const BOOST_NOEXCEPT { return tmp_lk_.mutex(); } /** * @return whether this lock is locking a mutex. */ bool owns_lock() const BOOST_NOEXCEPT { return true; } /** * @return whether if this lock is locking that mutex. */ bool owns_lock(mutex_type const* l) const BOOST_NOEXCEPT { return l == mutex(); } //BOOST_ADRESS_OF_DELETE(nested_strict_lock) //BOOST_HEAP_ALLOCATEION_DELETE(nested_strict_lock) private: Lock& lk_; Lock tmp_lk_; }; //] template <typename Lock> struct is_strict_lock_sur_parole<nested_strict_lock<Lock> > : true_type { }; #if ! defined BOOST_THREAD_NO_MAKE_STRICT_LOCK template <typename Lockable> strict_lock<Lockable> make_strict_lock(Lockable& mtx) { return { thread_detail::lockable_wrapper<Lockable>(mtx) }; } template <typename Lock> nested_strict_lock<Lock> make_nested_strict_lock(Lock& lk) { return { thread_detail::lockable_wrapper<Lock>(lk) }; } #endif } #include <boost/config/abi_suffix.hpp> #endif
Save
cmd:
run