From 8f4dae67732acc9334318f987c159f6176e3cdfd Mon Sep 17 00:00:00 2001 From: lillo Date: Wed, 31 Jul 2002 20:05:24 +0000 Subject: [PATCH] applied small patch to boost priority on sem block git-svn-id: file:///srv/svn/repos/haiku/trunk/current@547 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/kernel/core/sem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/kernel/core/sem.c b/src/kernel/core/sem.c index 7c0f33c83e..827b6c795c 100644 --- a/src/kernel/core/sem.c +++ b/src/kernel/core/sem.c @@ -500,9 +500,14 @@ int release_sem_etc(sem_id id, int count, int flags) // pull off any items in the release queue and put them in the run queue if (released_threads > 0) { struct thread *t; + int priority; GRAB_THREAD_LOCK(); while ((t = thread_dequeue(&release_queue)) != NULL) { + // temporarily place thread in a run queue with high priority to boost it up + priority = t->priority; + t->priority = t->priority >= THREAD_HIGH_PRIORITY ? t->priority : THREAD_HIGH_PRIORITY; thread_enqueue_run_q(t); + t->priority = priority; } if ((flags & B_DO_NOT_RESCHEDULE) == 0) { thread_resched();