summaryrefslogtreecommitdiff
path: root/thread.h
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2016-12-08 10:18:32 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2016-12-08 10:18:32 +0100
commit85ae27e372fa1c433bd01809848cbba46e6706a6 (patch)
treedd41eaeb12f5ef81f8798593fbd6ee5514209408 /thread.h
parentce6c90a4506a80bf7e8fa55d2ab643478e97183f (diff)
downloadvdr-85ae27e372fa1c433bd01809848cbba46e6706a6.tar.gz
vdr-85ae27e372fa1c433bd01809848cbba46e6706a6.tar.bz2
The cRwLock class now allows nested read locks within a write lock from the same thread
Diffstat (limited to 'thread.h')
-rw-r--r--thread.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/thread.h b/thread.h
index b5a07c79..9df677d3 100644
--- a/thread.h
+++ b/thread.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: thread.h 4.1 2015/08/17 13:06:24 kls Exp $
+ * $Id: thread.h 4.2 2016/12/08 10:18:32 kls Exp $
*/
#ifndef __THREAD_H
@@ -14,6 +14,8 @@
#include <stdio.h>
#include <sys/types.h>
+typedef pid_t tThreadId;
+
class cCondWait {
private:
pthread_mutex_t mutex;
@@ -53,6 +55,8 @@ public:
class cRwLock {
private:
pthread_rwlock_t rwlock;
+ int locked;
+ tThreadId writeLockThreadId;
public:
cRwLock(bool PreferWriter = false);
~cRwLock();
@@ -72,8 +76,6 @@ public:
void Unlock(void);
};
-typedef pid_t tThreadId;
-
class cThread {
friend class cThreadLock;
private: