Belle II Software  release-08-01-10
RWLock.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #ifndef _Belle2_RWLock_hh
9 #define _Belle2_RWLock_hh
10 
11 #include <pthread.h>
12 
13 namespace Belle2 {
19  class RWLock {
20 
21  public:
22  static size_t size()
23  {
24  return sizeof(pthread_rwlock_t);
25  }
26 
27  // constructors and destructor
28  public:
29  RWLock();
30  ~RWLock();
31 
32  // member functions;
33  public:
34  bool init();
35  bool rdlock();
36  bool wrlock();
37  bool unlock();
38  bool destroy();
39 
40  // data members;
41  private:
42  pthread_rwlock_t m_lock;
43 
44  };
45 
47 };
48 
49 #endif
Abstract base class for different kinds of events.