summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libthr/thread/thr_list.c')
-rw-r--r--lib/libthr/thread/thr_list.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libthr/thread/thr_list.c b/lib/libthr/thread/thr_list.c
index d46b5ea..56f5972 100644
--- a/lib/libthr/thread/thr_list.c
+++ b/lib/libthr/thread/thr_list.c
@@ -101,8 +101,7 @@ _thr_gc(struct pthread *curthread)
THREAD_LIST_LOCK(curthread);
/* Check the threads waiting for GC. */
- for (td = TAILQ_FIRST(&_thread_gc_list); td != NULL; td = td_next) {
- td_next = TAILQ_NEXT(td, gcle);
+ TAILQ_FOREACH_SAFE(td, &_thread_gc_list, gcle, td_next) {
if (td->tid != TID_TERMINATED) {
/* make sure we are not still in userland */
continue;
OpenPOWER on IntegriCloud