mirror of
https://github.com/VDR4Arch/vdr.git
synced 2023-10-10 13:36:52 +02:00
Added a warning if an attempt is made to obtain a write lock twice from the same thread
This commit is contained in:
parent
230adc8235
commit
5a029eb29f
1
HISTORY
1
HISTORY
@ -9794,3 +9794,4 @@ Video Disk Recorder Revision History
|
|||||||
for recordings that are currently being edited.
|
for recordings that are currently being edited.
|
||||||
- Fixed a possible crash if an editing process is canceled while the edited
|
- Fixed a possible crash if an editing process is canceled while the edited
|
||||||
recording is being replayed.
|
recording is being replayed.
|
||||||
|
- Added a warning if an attempt is made to obtain a write lock twice from the same thread.
|
||||||
|
10
thread.c
10
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.15 2020/09/16 13:48:33 kls Exp $
|
* $Id: thread.c 5.1 2022/11/13 15:25:52 kls Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
@ -753,6 +753,14 @@ bool cStateLock::Lock(cStateKey &StateKey, bool Write, int TimeoutMs)
|
|||||||
dbglocking("%5d %-12s %10p timeout\n", cThread::ThreadId(), name, &StateKey);
|
dbglocking("%5d %-12s %10p timeout\n", cThread::ThreadId(), name, &StateKey);
|
||||||
StateKey.timedOut = true;
|
StateKey.timedOut = true;
|
||||||
}
|
}
|
||||||
|
else if (threadId == cThread::ThreadId()) {
|
||||||
|
static bool DoubleWriteLockReported = false;
|
||||||
|
if (!DoubleWriteLockReported) {
|
||||||
|
dsyslog("WARNING: attempt to acquire write lock while already holding a write lock in the same thread - this may crash! (backtrace follows)");
|
||||||
|
cBackTrace::BackTrace();
|
||||||
|
DoubleWriteLockReported = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user