summaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_priority_queue.c
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>2003-04-28 23:56:12 +0000
committerDaniel Eischen <deischen@FreeBSD.org>2003-04-28 23:56:12 +0000
commit55613576f5c40d62fecb4ab76f012917fc399c3e (patch)
tree90f4ce3660289c401aab5d0a2c4f105e5aa3e877 /lib/libpthread/thread/thr_priority_queue.c
parent6a9ccd81fefc8a10772034a7e4955fccdacc347f (diff)
Notes
Diffstat (limited to 'lib/libpthread/thread/thr_priority_queue.c')
-rw-r--r--lib/libpthread/thread/thr_priority_queue.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libpthread/thread/thr_priority_queue.c b/lib/libpthread/thread/thr_priority_queue.c
index 3f261f8c1387d..2822aa81e7c45 100644
--- a/lib/libpthread/thread/thr_priority_queue.c
+++ b/lib/libpthread/thread/thr_priority_queue.c
@@ -126,6 +126,7 @@ _pq_init(pq_queue_t *pq)
/* Initialize the priority queue: */
TAILQ_INIT(&pq->pq_queue);
pq->pq_flags = 0;
+ pq->pq_threads = 0;
}
return (ret);
}
@@ -151,10 +152,10 @@ _pq_remove(pq_queue_t *pq, pthread_t pthread)
* from the priority queue when _pq_first is called.
*/
TAILQ_REMOVE(&pq->pq_lists[prio].pl_head, pthread, pqe);
-
+ pq->pq_threads--;
/* This thread is now longer in the priority queue. */
pthread->flags &= ~THR_FLAGS_IN_RUNQ;
-
+
PQ_CLEAR_ACTIVE(pq);
}
@@ -177,7 +178,7 @@ _pq_insert_head(pq_queue_t *pq, pthread_t pthread)
if (pq->pq_lists[prio].pl_queued == 0)
/* Insert the list into the priority queue: */
pq_insert_prio_list(pq, prio);
-
+ pq->pq_threads++;
/* Mark this thread as being in the priority queue. */
pthread->flags |= THR_FLAGS_IN_RUNQ;
@@ -203,7 +204,7 @@ _pq_insert_tail(pq_queue_t *pq, pthread_t pthread)
if (pq->pq_lists[prio].pl_queued == 0)
/* Insert the list into the priority queue: */
pq_insert_prio_list(pq, prio);
-
+ pq->pq_threads++;
/* Mark this thread as being in the priority queue. */
pthread->flags |= THR_FLAGS_IN_RUNQ;