mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 00:43:02 +01:00
Fixed CORE-5144: Deadlock when database is encrypted or decrypted under high parallel load
This commit is contained in:
parent
91c3270d37
commit
71f4da06d3
@ -319,7 +319,7 @@ namespace Jrd {
|
||||
if (!LCK_convert(tdbb, stateLock, CRYPT_NORMAL,
|
||||
(flags & CRYPT_HDR_NOWAIT) ? LCK_NO_WAIT : LCK_WAIT))
|
||||
{
|
||||
// Failed to take state lock - swith to slow IO mode
|
||||
// Failed to take state lock - switch to slow IO mode
|
||||
slowIO = LCK_read_data(tdbb, stateLock);
|
||||
fb_assert(slowIO);
|
||||
}
|
||||
|
@ -143,23 +143,26 @@ public:
|
||||
|
||||
if (counter < 0)
|
||||
{
|
||||
if ((counter % BIG_VALUE == 0) && (!flagWriteLock))
|
||||
if (!(flagWriteLock && (thread == getThreadId())))
|
||||
{
|
||||
if (lockMode)
|
||||
if ((counter % BIG_VALUE == 0) && (!flagWriteLock))
|
||||
{
|
||||
// Someone is waiting for write lock
|
||||
lockCond.notifyOne();
|
||||
barCond.wait(mutex);
|
||||
if (lockMode)
|
||||
{
|
||||
// Someone is waiting for write lock
|
||||
lockCond.notifyOne();
|
||||
barCond.wait(mutex);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ast done
|
||||
callWriteLockHandler(tdbb);
|
||||
counter = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ast done
|
||||
callWriteLockHandler(tdbb);
|
||||
counter = 0;
|
||||
}
|
||||
barCond.wait(mutex);
|
||||
}
|
||||
else if (!(flagWriteLock && (thread == getThreadId())))
|
||||
barCond.wait(mutex);
|
||||
}
|
||||
++counter;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user