From 34e6eaad5834f9ec459ef4b925c79d00b0f4899d Mon Sep 17 00:00:00 2001 From: Klaus Schmidinger Date: Sun, 23 Sep 2001 14:19:39 +0200 Subject: Fixed setting the locking PID in cMutex --- thread.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index ec66440e..f4ba76a1 100644 --- a/thread.c +++ b/thread.c @@ -4,7 +4,7 @@ * See the main source file 'vdr.c' for copyright information and * how to reach the author. * - * $Id: thread.c 1.12 2001/09/15 13:00:58 kls Exp $ + * $Id: thread.c 1.13 2001/09/23 14:04:35 kls Exp $ */ #include "thread.h" @@ -67,16 +67,19 @@ cMutex::~cMutex() void cMutex::Lock(void) { - if (getpid() != lockingPid || !locked) + if (getpid() != lockingPid || !locked) { pthread_mutex_lock(&mutex); - lockingPid = getpid(); + lockingPid = getpid(); + } locked++; } void cMutex::Unlock(void) { - if (!--locked) + if (!--locked) { + lockingPid = 0; pthread_mutex_unlock(&mutex); + } } // --- cThread --------------------------------------------------------------- -- cgit v1.2.3