From 5de22b9bf661cdf4c5864e3d5772b601771e7f44 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Tue, 28 Apr 2015 20:33:45 +0200 Subject: [PATCH] BLocker: make "unlock from wrong thread" only a warning. Calling Debugger here causes issues with some software (mainly Mesa). Only print a warning, this is enough for developers to see the problem, and not as annoying for users. --- src/kits/support/Locker.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/kits/support/Locker.cpp b/src/kits/support/Locker.cpp index 8ba01b8d13..e619d6e0fb 100644 --- a/src/kits/support/Locker.cpp +++ b/src/kits/support/Locker.cpp @@ -112,9 +112,11 @@ void BLocker::Unlock() { // The Be Book explicitly allows any thread, not just the lock owner, to - // unlock. This is bad practice and Haiku should not allow it. + // unlock. This is bad practice, but we must allow it for compatibility + // reasons. We can at least warn the developer that something is probably + // wrong. if (!IsLocked()) - debugger("Trying to unlock from the wrong thread (#6400)"); + fprintf(stderr, "Trying to unlock from the wrong thread (#6400)"); // Decrement the number of outstanding locks this thread holds // on this BLocker.