Shadowrun: Awakened 29 September 2011 - Build 871
Locks.h
Go to the documentation of this file.
00001 #ifndef __LOCKS_H
00002 #define __LOCKS_H
00003 
00004 #include <boost/thread/shared_mutex.hpp>
00005 #include <boost/thread/thread.hpp>
00006 #include "recursive_mutex.h"
00007 
00008 //Typedefs the shared_mutex and associated supports types as a 
00009 //slightly more user-friendly, template-free definitions
00010 //This also allows us to change between boost's lock or any other we wish
00011 
00012 typedef boost::shared_mutex ReaderWriterLockable;
00013 typedef boost::shared_lock<boost::shared_mutex> ReaderLock;
00014 typedef boost::lock_guard<boost::shared_mutex> WriterLock;
00015 
00016 #define READER_LOCK(lockable) ReaderLock lock(lockable);
00017 #define WRITER_LOCK(lockable) WriterLock lock(lockable);
00018 
00019 #endif

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net