mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Fixed removing a cStateKey from a cStateLock
This commit is contained in:
parent
a7fdd3c165
commit
bb4b6901ad
2
HISTORY
2
HISTORY
@ -9298,3 +9298,5 @@ Video Disk Recorder Revision History
|
|||||||
- Assigning events to timers no longer triggers sending a POLL to all peer VDRs.
|
- Assigning events to timers no longer triggers sending a POLL to all peer VDRs.
|
||||||
- When making modifications to remote timers, the local VDR no longer sends a POLL to
|
- When making modifications to remote timers, the local VDR no longer sends a POLL to
|
||||||
all remote VDRs.
|
all remote VDRs.
|
||||||
|
- Fixed removing a cStateKey from a cStateLock (setting StateKey.stateLock = NULL was
|
||||||
|
done too late, after the lock had already been released).
|
||||||
|
7
thread.c
7
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 4.13 2018/03/04 13:17:04 kls Exp $
|
* $Id: thread.c 4.14 2018/03/05 22:38:10 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
@ -775,6 +775,7 @@ void cStateLock::Unlock(cStateKey &StateKey, bool IncState)
|
|||||||
state++;
|
state++;
|
||||||
}
|
}
|
||||||
StateKey.state = state;
|
StateKey.state = state;
|
||||||
|
StateKey.stateLock = NULL;
|
||||||
if (StateKey.write) {
|
if (StateKey.write) {
|
||||||
StateKey.write = false;
|
StateKey.write = false;
|
||||||
threadId = 0;
|
threadId = 0;
|
||||||
@ -857,10 +858,8 @@ void cStateKey::Reset(void)
|
|||||||
|
|
||||||
void cStateKey::Remove(bool IncState)
|
void cStateKey::Remove(bool IncState)
|
||||||
{
|
{
|
||||||
if (stateLock) {
|
if (stateLock)
|
||||||
stateLock->Unlock(*this, IncState);
|
stateLock->Unlock(*this, IncState);
|
||||||
stateLock = NULL;
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
esyslog("ERROR: cStateKey::Remove() called without holding a lock (key=%p)", this);
|
esyslog("ERROR: cStateKey::Remove() called without holding a lock (key=%p)", this);
|
||||||
ABORT;
|
ABORT;
|
||||||
|
Loading…
Reference in New Issue
Block a user