libzypp  13.10.6
Mutex.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
11 #ifndef ZYPP_THREAD_MUTEX_H
12 #define ZYPP_THREAD_MUTEX_H
13 
14 #include "zypp/base/NonCopyable.h"
16 #include <pthread.h>
17 
19 namespace zypp
20 {
21  namespace thread
23  {
24 
25 
26  typedef pthread_mutex_t RecursiveMutex_t;
27 
28 
30  //
31  // CLASS NAME : Mutex
32  //
36  {
37  public:
41  Mutex();
42 
45  ~Mutex();
46 
58  void lock();
59 
68  void unlock();
69 
79  bool trylock();
80 
81  private:
83  };
84 
85 
87  } // namespace thread
90 } // namespace zypp
92 
93 #endif // ZYPP_THREAD_MUTEX_H
94 /*
95 ** vim: set ts=2 sts=2 sw=2 ai et:
96 */
pthread_mutex_t RecursiveMutex_t
Definition: Mutex.h:26
bool trylock()
Try to acquire ownership of this Mutex object.
Definition: Mutex.cc:92
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
void lock()
Acquire ownership of this Mutex object.
Definition: Mutex.cc:72
A recursive Mutex.
Definition: Mutex.h:35
Mutex()
Create a new recursive Mutex object.
Definition: Mutex.cc:25
void unlock()
Release ownership of this Mutex object.
Definition: Mutex.cc:82
~Mutex()
Destroys this Mutex object.
Definition: Mutex.cc:52
RecursiveMutex_t m_mutex
Definition: Mutex.h:82