NLS Engine  v0.1
The Next Logical Step in game engine design.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines
threading.h
Go to the documentation of this file.
00001 
00011 #pragma once
00012 
00013 #include <boost/thread.hpp>
00014 
00015 namespace Threading {
00016   typedef boost::shared_mutex ReadWriteMutex;
00017   typedef boost::shared_lock<ReadWriteMutex> ReadLock;
00018   typedef boost::upgrade_lock<ReadWriteMutex> UpgradeLock;
00019   typedef boost::unique_lock<ReadWriteMutex> WriteLock;
00020   
00021   typedef boost::upgrade_to_unique_lock<ReadWriteMutex> UpgradeToUniqueLock;
00022   
00023   template<typename T>
00024   inline void Swap(T& left, T& right) {
00025     T temp = right;
00026     right = left;
00027     left = temp;
00028   }
00029 }