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
This commit is contained in:
Ingo Weinhold 2002-09-03 16:56:48 +00:00
parent 4b14055011
commit 7bb1eb8242

View File

@ -595,7 +595,7 @@ DBG(OUT(" ... done: %lx\n", err));
int32 temp; int32 temp;
do do
{ {
DBG(OUT(" wait_for_thread()...\n")); DBG(OUT(" wait_for_thread(%lx)...\n", tid));
err = wait_for_thread(tid, &temp); err = wait_for_thread(tid, &temp);
} while (err == B_INTERRUPTED); } while (err == B_INTERRUPTED);
} }
@ -1191,6 +1191,7 @@ DBG(OUT("LOOPER: looper locked\n"));
delete obj; delete obj;
} }
DBG(OUT("LOOPER: _task0_() done: thread %ld\n", find_thread(NULL)));
return B_OK; return B_OK;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
@ -1591,8 +1592,9 @@ void BLooper::UnlockFully()
// Nobody owns the lock now // Nobody owns the lock now
fOwner = -1; fOwner = -1;
// There is now one less thread holding a lock on this looper // There is now one less thread holding a lock on this looper
long atomicCount = atomic_add(&fAtomicCount, -1); // bonefish: Currently _Lock() always acquires the semaphore.
if (atomicCount > 0) /* long atomicCount = */atomic_add(&fAtomicCount, -1);
// if (atomicCount > 0)
{ {
release_sem(fLockSem); release_sem(fLockSem);
} }