PReadWriteLock.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PObject.h>
17 
18 PAPILLON_BEGIN_NAMESPACE
19 
42 class PAPILLON_API_CORE PReadWriteLock : public PObject
43 {
44 public:
54  PReadWriteLock(bool isRecursive = false);
55 
59  PReadWriteLock(const PReadWriteLock& other);
60 
64  virtual ~PReadWriteLock();
65 
70 
76  void LockForRead();
77 
84  void LockForWrite();
85 
90  void Unlock();
91 
104  bool TryLockForRead(papillon::int32 timeOutMs);
105 
116  bool TryLockForWrite(papillon::int32 timeOutMs);
117 };
118 
119 PAPILLON_END_NAMESPACE
The PReadWriteLock class provides access serialization between threads.
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
Class PObject: the root class of all Papillon classes.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45