diff options
author | Jason Evans <jasone@FreeBSD.org> | 2001-05-18 00:36:05 +0000 |
---|---|---|
committer | Jason Evans <jasone@FreeBSD.org> | 2001-05-18 00:36:05 +0000 |
commit | ffc19644c071b7e9ec1fe21d95c8d12ea0f47d93 (patch) | |
tree | 3105e7f8dd27d883d98f047ecae3333a0fb77cae | |
parent | 210ea397b87ca77a208dc55ce24c7e2ff0978ada (diff) |
Notes
-rw-r--r-- | lib/libc_r/uthread/uthread_sem.c | 11 | ||||
-rw-r--r-- | lib/libkse/thread/thr_sem.c | 11 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_sem.c | 11 |
3 files changed, 6 insertions, 27 deletions
diff --git a/lib/libc_r/uthread/uthread_sem.c b/lib/libc_r/uthread/uthread_sem.c index 9ed6922d38f27..851eca293ae66 100644 --- a/lib/libc_r/uthread/uthread_sem.c +++ b/lib/libc_r/uthread/uthread_sem.c @@ -226,15 +226,8 @@ _sem_post(sem_t *sem) pthread_mutex_lock(&(*sem)->lock); (*sem)->count++; - if ((*sem)->nwaiters > 0) { - /* - * We must use pthread_cond_broadcast() rather than - * pthread_cond_signal() in order to assure that the highest - * priority thread is run by the scheduler, since - * pthread_cond_signal() signals waiting threads in FIFO order. - */ - pthread_cond_broadcast(&(*sem)->gtzero); - } + if ((*sem)->nwaiters > 0) + pthread_cond_signal(&(*sem)->gtzero); pthread_mutex_unlock(&(*sem)->lock); diff --git a/lib/libkse/thread/thr_sem.c b/lib/libkse/thread/thr_sem.c index 9ed6922d38f27..851eca293ae66 100644 --- a/lib/libkse/thread/thr_sem.c +++ b/lib/libkse/thread/thr_sem.c @@ -226,15 +226,8 @@ _sem_post(sem_t *sem) pthread_mutex_lock(&(*sem)->lock); (*sem)->count++; - if ((*sem)->nwaiters > 0) { - /* - * We must use pthread_cond_broadcast() rather than - * pthread_cond_signal() in order to assure that the highest - * priority thread is run by the scheduler, since - * pthread_cond_signal() signals waiting threads in FIFO order. - */ - pthread_cond_broadcast(&(*sem)->gtzero); - } + if ((*sem)->nwaiters > 0) + pthread_cond_signal(&(*sem)->gtzero); pthread_mutex_unlock(&(*sem)->lock); diff --git a/lib/libpthread/thread/thr_sem.c b/lib/libpthread/thread/thr_sem.c index 9ed6922d38f27..851eca293ae66 100644 --- a/lib/libpthread/thread/thr_sem.c +++ b/lib/libpthread/thread/thr_sem.c @@ -226,15 +226,8 @@ _sem_post(sem_t *sem) pthread_mutex_lock(&(*sem)->lock); (*sem)->count++; - if ((*sem)->nwaiters > 0) { - /* - * We must use pthread_cond_broadcast() rather than - * pthread_cond_signal() in order to assure that the highest - * priority thread is run by the scheduler, since - * pthread_cond_signal() signals waiting threads in FIFO order. - */ - pthread_cond_broadcast(&(*sem)->gtzero); - } + if ((*sem)->nwaiters > 0) + pthread_cond_signal(&(*sem)->gtzero); pthread_mutex_unlock(&(*sem)->lock); |