fw4spl
core/fwCore/include/fwCore/mt/types.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2015.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #ifndef __FWCORE_MT_TYPES_HPP__
8 #define __FWCORE_MT_TYPES_HPP__
9 
10 #include <boost/thread/locks.hpp>
11 #include <boost/thread/mutex.hpp>
12 #include <boost/thread/shared_mutex.hpp>
13 #include <boost/thread/recursive_mutex.hpp>
14 
15 namespace fwCore
16 {
17 namespace mt
18 {
19 
20 typedef ::boost::mutex Mutex;
21 typedef ::boost::unique_lock< Mutex > ScopedLock;
22 
23 typedef ::boost::recursive_mutex RecursiveMutex;
24 typedef ::boost::unique_lock< RecursiveMutex > RecursiveScopedLock;
25 
27 typedef ::boost::shared_mutex ReadWriteMutex;
32 typedef ::boost::shared_lock< ReadWriteMutex > ReadLock;
37 typedef ::boost::unique_lock< ReadWriteMutex > WriteLock;
42 typedef ::boost::upgrade_lock< ReadWriteMutex > ReadToWriteLock;
47 typedef ::boost::upgrade_to_unique_lock< ReadWriteMutex > UpgradeToWriteLock;
48 
49 } //namespace mt
50 } //namespace fwCore
51 
52 #endif /* __FWCORE_MT_TYPES_HPP__ */
::boost::upgrade_lock< ReadWriteMutex > ReadToWriteLock
Defines an upgradable lock type for read/write mutex.
::boost::upgrade_to_unique_lock< ReadWriteMutex > UpgradeToWriteLock
Defines a write lock upgraded from ReadToWriteLock.
::boost::shared_mutex ReadWriteMutex
Defines a single writer, multiple readers mutex.
This namespace fwCore provides common foundations for FW4SPL.
Definition: BaseObject.hpp:16
::boost::unique_lock< ReadWriteMutex > WriteLock
Defines a lock of write type for read/write mutex.
::boost::shared_lock< ReadWriteMutex > ReadLock
Defines a lock of read type for read/write mutex.