ScopedRWLock.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_SCOPED_RWLOCK_H_INCLUDED
30 #define ICL_CORE_THREAD_SCOPED_RWLOCK_H_INCLUDED
31 
32 #include <icl_core/BaseTypes.h>
33 #include <icl_core/Noncopyable.h>
35 
36 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
37 # include "icl_core/Deprecate.h"
38 #endif
39 
40 namespace icl_core {
41 namespace thread {
42 
43 class RWLock;
44 
51 {
52 public:
54  enum LockMode
55  {
57  eLM_WRITE_LOCK
58  };
59 
66  explicit ScopedRWLock(RWLock& lock, LockMode lock_mode, bool force = true);
67 
70  ~ScopedRWLock();
71 
74  bool isLocked() const { return m_is_locked; }
75 
79  operator bool () const { return isLocked(); }
80 
82 #ifdef _IC_BUILDER_DEPRECATED_STYLE_
83 
88 
89 #endif
90 
92 private:
95 };
96 
97 }
98 }
99 
100 #endif
LockMode
The type of lock to obtain on the read-write lock.
Definition: ScopedRWLock.h:54
#define ICL_CORE_VC_DEPRECATE_STYLE
Definition: Deprecate.h:53
Contains macros to deprecate classes, types, functions and variables.
Contains import/export definitions for the Win32 plattform.
#define ICL_CORE_THREAD_IMPORT_EXPORT
Manages locking and unlocking of a read-write lock.
Definition: ScopedRWLock.h:50
Contains Interface base classes and base types.
Contains icl_core::Noncopyable.
#define ICL_CORE_GCC_DEPRECATE_STYLE
Definition: Deprecate.h:54


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