B_RELEASE_ALL is now a bit faster if it has nothing to do.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9349 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2004-10-14 14:37:39 +00:00
parent d67750858c
commit f197107a3d

View File

@ -562,9 +562,14 @@ release_sem_etc(sem_id id, int32 count, uint32 flags)
// order in sem_interrupt_thread.
releaseQueue.head = releaseQueue.tail = NULL;
if (flags & B_RELEASE_ALL)
if (flags & B_RELEASE_ALL) {
count = -gSems[slot].u.used.count;
// is there anything to do for us at all?
if (count == 0)
goto err;
}
while (count > 0) {
int delta = count;
if (gSems[slot].u.used.count < 0) {