From 7bb1eb8242fe3721fc858bba0dbade1c15e472b7 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Tue, 3 Sep 2002 16:56:48 +0000 Subject: [PATCH] Fixed BLooper::UnlockFully(): It assumed benaphore style locking whereas semaphore style is used. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@977 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kits/app/Looper.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/kits/app/Looper.cpp b/src/kits/app/Looper.cpp index 6e825ead49..976ec5125a 100644 --- a/src/kits/app/Looper.cpp +++ b/src/kits/app/Looper.cpp @@ -595,7 +595,7 @@ DBG(OUT(" ... done: %lx\n", err)); int32 temp; do { -DBG(OUT(" wait_for_thread()...\n")); +DBG(OUT(" wait_for_thread(%lx)...\n", tid)); err = wait_for_thread(tid, &temp); } while (err == B_INTERRUPTED); } @@ -1191,6 +1191,7 @@ DBG(OUT("LOOPER: looper locked\n")); delete obj; } +DBG(OUT("LOOPER: _task0_() done: thread %ld\n", find_thread(NULL))); return B_OK; } //------------------------------------------------------------------------------ @@ -1591,8 +1592,9 @@ void BLooper::UnlockFully() // Nobody owns the lock now fOwner = -1; // There is now one less thread holding a lock on this looper - long atomicCount = atomic_add(&fAtomicCount, -1); - if (atomicCount > 0) +// bonefish: Currently _Lock() always acquires the semaphore. +/* long atomicCount = */atomic_add(&fAtomicCount, -1); +// if (atomicCount > 0) { release_sem(fLockSem); }