Beam-lib  2.16.3
This is the Beam C++ class library.
BRWLock.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * BRWLock.h BRWLock Classes
3  * T.Barnaby, BEAM Ltd, 3/07/03
4  * Copyright (c) 2012 All Right Reserved, Beam Ltd, http://www.beam.ltd.uk
5  *******************************************************************************
6  */
7 #ifndef BRWLOCK_H
8 #define BRWLOCK_H 1
9 
10 #include <pthread.h>
11 
13 class BRWLock {
14 public:
15  BRWLock();
16  BRWLock(const BRWLock& rwlock);
17  ~BRWLock();
18 
19  int rdLock();
20  int tryRdLock();
21  int wrLock();
22  int tryWrLock();
23  int unlock();
24 
25  BRWLock& operator=(const BRWLock& rwlock);
26 private:
27  pthread_rwlock_t olock;
28 };
29 
30 #endif
int tryWrLock()
Test the lock.
Definition: BRWLock.cpp:36
int unlock()
Unlock the lock.
Definition: BRWLock.cpp:40
int tryRdLock()
Test the lock.
Definition: BRWLock.cpp:28
thread read-write locks
Definition: BRWLock.h:13
int wrLock()
Set lock, wait if necessary.
Definition: BRWLock.cpp:32
~BRWLock()
Definition: BRWLock.cpp:20
BRWLock()
Definition: BRWLock.cpp:8
BRWLock & operator=(const BRWLock &rwlock)
Definition: BRWLock.cpp:16
int rdLock()
Set lock, wait if necessary.
Definition: BRWLock.cpp:24