Belle II Software  release-05-02-19
MMutex.h
1 #ifndef _Belle2_MMutex_h
2 #define _Belle2_MMutex_h
3 
4 #include <pthread.h>
5 
6 #ifdef __CINT__
7 #undef __GNUC__
8 #define _SYS__SELECT_H_
9 struct pthread_cond_t;
10 struct pthread_mutex_t;
11 #endif
12 
13 namespace Belle2 {
19  class MMutex {
20 
21  friend class MCond;
22 
23  public:
24  static size_t size() { return sizeof(pthread_mutex_t); }
25 
26  // constructors and destructor
27  public:
28  MMutex();
29  MMutex(void*);
30  MMutex(const MMutex&);
31  ~MMutex();
32 
33  // member functions;
34  public:
35  bool init(void*);
36  bool init();
37  bool set(void*);
38  bool lock();
39  bool trylock();
40  bool unlock();
41  bool destroy();
42 
43  public:
44  const MMutex& operator=(const MMutex&);
45 
46  // data members;
47  private:
48  pthread_mutex_t* m_mu;
49 
50  };
51 
53 };
54 
55 #endif
Belle2::MMutex
Definition: MMutex.h:19
Belle2::MCond
Definition: MCond.h:14
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19