diff options
-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 9ed6922..851eca2 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 9ed6922..851eca2 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 9ed6922..851eca2 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); |