mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed setting the locking PID in cMutex
This commit is contained in:
parent
f412897373
commit
34e6eaad58
2
HISTORY
2
HISTORY
@ -759,7 +759,7 @@ Video Disk Recorder Revision History
|
|||||||
audio output volume.
|
audio output volume.
|
||||||
- New version of the 'epg2timers' tool (thanks to Carsten Koch).
|
- New version of the 'epg2timers' tool (thanks to Carsten Koch).
|
||||||
|
|
||||||
2001-09-21: Version 0.96
|
2001-09-23: Version 0.96
|
||||||
|
|
||||||
- Made VDR compile with libdvdread-0.9.1 (thanks to Andreas Schultz).
|
- Made VDR compile with libdvdread-0.9.1 (thanks to Andreas Schultz).
|
||||||
Note that you now _need_ version 0.9.1 of libdvdread to compile VDR with
|
Note that you now _need_ version 0.9.1 of libdvdread to compile VDR with
|
||||||
|
11
thread.c
11
thread.c
@ -4,7 +4,7 @@
|
|||||||
* See the main source file 'vdr.c' for copyright information and
|
* See the main source file 'vdr.c' for copyright information and
|
||||||
* how to reach the author.
|
* 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"
|
#include "thread.h"
|
||||||
@ -67,16 +67,19 @@ cMutex::~cMutex()
|
|||||||
|
|
||||||
void cMutex::Lock(void)
|
void cMutex::Lock(void)
|
||||||
{
|
{
|
||||||
if (getpid() != lockingPid || !locked)
|
if (getpid() != lockingPid || !locked) {
|
||||||
pthread_mutex_lock(&mutex);
|
pthread_mutex_lock(&mutex);
|
||||||
lockingPid = getpid();
|
lockingPid = getpid();
|
||||||
|
}
|
||||||
locked++;
|
locked++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void cMutex::Unlock(void)
|
void cMutex::Unlock(void)
|
||||||
{
|
{
|
||||||
if (!--locked)
|
if (!--locked) {
|
||||||
|
lockingPid = 0;
|
||||||
pthread_mutex_unlock(&mutex);
|
pthread_mutex_unlock(&mutex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- cThread ---------------------------------------------------------------
|
// --- cThread ---------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user