Skip to content

Commit 74ed413

Browse files
committed
Fix crash in Android build.
1 parent 6d05b7c commit 74ed413

File tree

2 files changed

+27
-6
lines changed

2 files changed

+27
-6
lines changed

src/lock/lock.cpp

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,7 +1340,7 @@ lbl* LockManager::alloc_lock(USHORT length, CheckStatusWrapper* statusVector)
13401340
}
13411341

13421342

1343-
void LockManager::blocking_action(const Callbacks* callbacks,
1343+
void LockManager::blocking_action(const Callbacks& callbacks,
13441344
SRQ_PTR blocking_owner_offset)
13451345
{
13461346
/**************************************
@@ -1399,8 +1399,7 @@ void LockManager::blocking_action(const Callbacks* callbacks,
13991399
{ // checkout scope
14001400
LockTableCheckout checkout(this, FB_FUNCTION);
14011401

1402-
fb_assert(callbacks);
1403-
callbacks->checkoutRun([&] {
1402+
callbacks.checkoutRun([&] {
14041403
try
14051404
{
14061405
(*routine)(arg);
@@ -1488,7 +1487,29 @@ void LockManager::blocking_action_thread()
14881487
{
14891488
const SRQ_PTR owner_offset = SRQ_REL_PTR(owner);
14901489
guard.setOwner(owner_offset);
1491-
blocking_action(nullptr, owner_offset);
1490+
1491+
class BlockingActionCallbacks final : public Callbacks
1492+
{
1493+
public:
1494+
ISC_STATUS getCancelState() const override
1495+
{
1496+
fb_assert(false);
1497+
return 0;
1498+
}
1499+
1500+
ULONG adjustWait(ULONG wait) const override
1501+
{
1502+
fb_assert(false);
1503+
return wait;
1504+
}
1505+
1506+
void checkoutRun(std::function<void()> func) const override
1507+
{
1508+
func();
1509+
}
1510+
};
1511+
1512+
blocking_action(BlockingActionCallbacks(), owner_offset);
14921513
completed = false;
14931514
break;
14941515
}
@@ -3205,7 +3226,7 @@ bool LockManager::signal_owner(const Callbacks& callbacks, own* blocking_owner)
32053226
if (process->prc_process_id == PID)
32063227
{
32073228
DEBUG_DELAY;
3208-
blocking_action(&callbacks, SRQ_REL_PTR(blocking_owner));
3229+
blocking_action(callbacks, SRQ_REL_PTR(blocking_owner));
32093230
DEBUG_DELAY;
32103231
return true;
32113232
}

src/lock/lock_proto.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class LockManager final : public Firebird::GlobalStorage, public Firebird::IpcOb
427427
void acquire_shmem(SRQ_PTR);
428428
UCHAR* alloc(USHORT, Firebird::CheckStatusWrapper*);
429429
lbl* alloc_lock(USHORT, Firebird::CheckStatusWrapper*);
430-
void blocking_action(const Callbacks*, SRQ_PTR);
430+
void blocking_action(const Callbacks&, SRQ_PTR);
431431
void blocking_action_thread();
432432
void bug(Firebird::CheckStatusWrapper*, const TEXT*);
433433
void bug_assert(const TEXT*, ULONG);

0 commit comments

Comments
 (0)