30 #ifndef STTCL_DEFAULT_MUTEXIMPL
31 #if defined(STTCL_POSIX_THREADS) or defined(STTCL_POSIX_IMPL)
32 #include "../PosixThreads/SttclPosixMutex.h"
33 #define STTCL_DEFAULT_MUTEXIMPL sttcl::internal::posix_impl::SttclPosixMutex
34 #elif defined(STTCL_BOOST_THREADS) or defined(STTCL_BOOST_IMPL)
35 #include "../BoostThreads/SttclBoostMutex.h"
36 #define STTCL_DEFAULT_MUTEXIMPL sttcl::internal::boost_impl::SttclBoostMutex
37 #elif defined(STTCL_CX11_THREADS) or defined(STTCL_CX11_IMPL)
38 #include "../C++11Threads/SttclCx11Mutex.h"
39 #define STTCL_DEFAULT_MUTEXIMPL sttcl::internal::cx11_impl::SttclCx11Mutex
42 #ifndef STTCL_DEFAULT_MUTEXIMPL
43 #error "You need to define a default mutex implementation for sttcl"
60 <
class Impl = STTCL_DEFAULT_MUTEXIMPL
61 ,
class TimeDurationType = TimeDuration<STTCL_DEFAULT_TIMEDURATIONIMPL>
81 static_cast<Impl*
>(
this)->
lock();
92 bool try_lock(
const TimeDurationType& timeout = TimeDurationType::Zero)
94 return static_cast<Impl*
>(
this)->
try_lock(timeout);
102 static_cast<Impl*
>(
this)->
unlock();
110 template<
class Lockable>
119 : ref(argLockableRef)