thread/SingletonThreadingModels.h
Go to the documentation of this file.
1 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*-
2 
3 // -- BEGIN LICENSE BLOCK ----------------------------------------------
4 // This file is part of FZIs ic_workspace.
5 //
6 // This program is free software licensed under the LGPL
7 // (GNU LESSER GENERAL PUBLIC LICENSE Version 3).
8 // You can find a copy of this license in LICENSE folder in the top
9 // directory of the source code.
10 //
11 // © Copyright 2016 FZI Forschungszentrum Informatik, Karlsruhe, Germany
12 //
13 // -- END LICENSE BLOCK ------------------------------------------------
14 
15 //----------------------------------------------------------------------
28 //----------------------------------------------------------------------
29 #ifndef ICL_CORE_THREAD_SINGLETON_THREADING_MODELS_H_INCLUDED
30 #define ICL_CORE_THREAD_SINGLETON_THREADING_MODELS_H_INCLUDED
31 
32 #include "icl_core_thread/tMutex.h"
34 
35 namespace icl_core {
36 namespace thread {
37 
39 template
40 <class T>
42 {
43 public:
45  static inline void memoryBarrier()
46  {
47 #if defined(_SYSTEM_WIN32_)
48  ::MemoryBarrier();
49 #elif defined(__GNUC__)
50  __asm__ __volatile__ ("" ::: "memory");
51 #else
52 # error "No memory barrier implementation is available for your system."
53 #endif
54  }
55 
57  typedef ::icl_core::thread::ScopedMutexLock Guard;
58 
60  typedef ::icl_core::thread::Mutex Lock;
61 };
62 
63 }
64 }
65 
66 #endif
::icl_core::thread::ScopedMutexLock Guard
Use ScopedMutexLock as the lock guard.
Mutex-based thread-safe singleton threading model.
::icl_core::thread::Mutex Lock
Use Mutex as the actual lock.
static void memoryBarrier()
Memory barrier for synchronization.


fzi_icl_core
Author(s):
autogenerated on Mon Jun 10 2019 13:17:58