logging/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_LOGGING_SINGLETON_THREADING_MODELS_H_INCLUDED
30 #define ICL_CORE_LOGGING_SINGLETON_THREADING_MODELS_H_INCLUDED
31 
34 
35 namespace icl_core {
36 namespace logging {
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::logging::ScopedSemaphore Guard;
58 
60  typedef ::icl_core::logging::Semaphore Lock;
61 };
62 
63 }
64 }
65 
66 #endif
static void memoryBarrier()
Memory barrier for synchronization.
Semaphore-based thread-safe singleton threading model.
::icl_core::logging::ScopedSemaphore Guard
Use ScopedSemaphore as the lock guard.
::icl_core::logging::Semaphore Lock
Use Semaphore as the actual lock.


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