Skip to content

Commit b382e79

Browse files
committed
Testing failed CI test for MacOS
1 parent 7e47bff commit b382e79

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

src/main/ipc/SharedMutex.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,14 @@ namespace lsp
496496
// Check that we don't lock the mutex again
497497
const thread_id_t tid = Thread::current_thread_id();
498498
if (atomic_load(&nOwner) == tid)
499+
{
500+
lsp_warn("tried to lock by owner");
499501
return STATUS_LOCKED;
502+
}
500503

501504
#ifdef PLATFORM_WINDOWS
505+
lsp_warn("using windows implementation");
506+
502507
DWORD res = WaitForSingleObject(hLock, delay);
503508
switch (res)
504509
{
@@ -516,6 +521,8 @@ namespace lsp
516521

517522
return STATUS_UNKNOWN_ERR;
518523
#elif defined(LSP_ROBUST_MUTEX_SUPPORTED)
524+
lsp_warn("using robust mutex implementation");
525+
519526
// sem_timedwait() is the same as sem_wait(), except that abs_timeout specifies a limit on the
520527
// amount of time that the call should block if the decrement cannot be immediately performed.
521528
// The abs_timeout argument points to a structure that specifies an absolute timeout in seconds
@@ -536,7 +543,9 @@ namespace lsp
536543
{
537544
case 0: break;
538545
case EDEADLK: return STATUS_BAD_STATE;
539-
case EBUSY: return STATUS_LOCKED;
546+
case EBUSY:
547+
lsp_warn("got EBUSY error");
548+
return STATUS_LOCKED;
540549
case ETIMEDOUT: return STATUS_TIMED_OUT;
541550
case EOWNERDEAD:
542551
{
@@ -550,6 +559,8 @@ namespace lsp
550559

551560
return STATUS_OK;
552561
#else
562+
lsp_warn("using flock implementation");
563+
553564
// Since we can not lock file without using signals, we need to simulate the timed wait with a loop
554565
const system::time_millis_t deadline = system::get_time_millis() + delay;
555566
while (true)

src/test/utest/ipc/shmutex.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ UTEST_BEGIN("runtime.ipc", shmutex)
4242

4343
data.append_ascii(event);
4444
data.append('=');
45-
data.append_ascii((code == expected) ? "true" : "false");
45+
if (code == expected)
46+
data.append_ascii("true");
47+
else
48+
data.fmt_append_ascii("false(code=%d)", int(code));
4649
data.append(';');
4750
}
4851
} context_t;

0 commit comments

Comments
 (0)