@@ -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 )
0 commit comments