From 85ae27e372fa1c433bd01809848cbba46e6706a6 Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Thu, 8 Dec 2016 10:18:32 +0100 Subject: The cRwLock class now allows nested read locks within a write lock from the same thread --- thread.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'thread.h') 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 #include +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: -- cgit v1.2.3