Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00028 
00029 #ifndef ICL_CORE_THREAD_SINGLETON_THREADING_MODELS_H_INCLUDED
00030 #define ICL_CORE_THREAD_SINGLETON_THREADING_MODELS_H_INCLUDED
00031 
00032 #include "icl_core_thread/tMutex.h"
00033 #include "icl_core_thread/tScopedMutexLock.h"
00034 
00035 namespace icl_core {
00036 namespace thread {
00037 
00039 template
00040 <class T>
00041 class STMMultiThreadedWithMutex
00042 {
00043 public:
00045   static inline void memoryBarrier()
00046   {
00047 #if defined(_SYSTEM_WIN32_)
00048     ::MemoryBarrier();
00049 #elif defined(__GNUC__)
00050     __asm__ __volatile__ ("" ::: "memory");
00051 #else
00052 # error "No memory barrier implementation is available for your system."
00053 #endif
00054   }
00055 
00057   typedef ::icl_core::thread::ScopedMutexLock Guard;
00058 
00060   typedef ::icl_core::thread::Mutex Lock;
00061 };
00062 
00063 }
00064 }
00065 
00066 #endif