SingletonThreadingModels.h
Go to the documentation of this file.
00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
00002 
00003 // -- BEGIN LICENSE BLOCK ----------------------------------------------
00004 // This file is part of FZIs ic_workspace.
00005 //
00006 // This program is free software licensed under the LGPL
00007 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
00008 // You can find a copy of this license in LICENSE folder in the top
00009 // directory of the source code.
00010 //
00011 // © Copyright 2014 FZI Forschungszentrum Informatik, Karlsruhe, Germany
00012 //
00013 // -- END LICENSE BLOCK ------------------------------------------------
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


schunk_svh_driver
Author(s): Georg Heppner
autogenerated on Fri Aug 28 2015 12:59:19