|
Boost-Commit : |
From: anthony_at_[hidden]
Date: 2008-04-13 11:50:09
Author: anthonyw
Date: 2008-04-13 11:50:08 EDT (Sun, 13 Apr 2008)
New Revision: 44370
URL: http://svn.boost.org/trac/boost/changeset/44370
Log:
Added extended adopt/defer/try constructors to upgrade_lock
Text files modified:
trunk/boost/thread/locks.hpp | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
Modified: trunk/boost/thread/locks.hpp
==============================================================================
--- trunk/boost/thread/locks.hpp (original)
+++ trunk/boost/thread/locks.hpp 2008-04-13 11:50:08 EDT (Sun, 13 Apr 2008)
@@ -400,13 +400,16 @@
{
lock();
}
- upgrade_lock(Mutex& m_,bool do_lock):
+ upgrade_lock(Mutex& m_,adopt_lock_t):
+ m(&m_),is_locked(true)
+ {}
+ upgrade_lock(Mutex& m_,defer_lock_t):
+ m(&m_),is_locked(false)
+ {}
+ upgrade_lock(Mutex& m_,try_to_lock_t):
m(&m_),is_locked(false)
{
- if(do_lock)
- {
- lock();
- }
+ try_lock();
}
upgrade_lock(detail::thread_move_t<upgrade_lock<Mutex> > other):
m(other->m),is_locked(other->is_locked)
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk