We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0d7a20 commit 2caa4f7Copy full SHA for 2caa4f7
1 file changed
src/jrd/vio.cpp
@@ -297,7 +297,16 @@ inline void waitGCActive(thread_db* tdbb, const record_param* rpb)
297
Lock temp_lock(tdbb, sizeof(SINT64), LCK_record_gc);
298
temp_lock.setKey(((SINT64) rpb->rpb_page << 16) | rpb->rpb_line);
299
300
- if (!LCK_lock(tdbb, &temp_lock, LCK_SR, LCK_WAIT))
+ SSHORT wait = LCK_WAIT;
301
+
302
+ jrd_tra* transaction = tdbb->getTransaction();
303
+ if (transaction->tra_number == rpb->rpb_transaction_nr)
304
+ {
305
+ // There is no sense to wait for self
306
+ wait = LCK_NO_WAIT;
307
+ }
308
309
+ if (!LCK_lock(tdbb, &temp_lock, LCK_SR, wait))
310
ERR_punt();
311
312
LCK_release(tdbb, &temp_lock);
0 commit comments