diff options
author | delphij <delphij@FreeBSD.org> | 2006-07-17 09:23:44 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2006-07-17 09:23:44 +0000 |
commit | 36c285d1286bd583e9d7ee6685013ab9058acfcc (patch) | |
tree | ee07dd39ba798682ef9bfd4811e2c904be7109b2 /lib/libthr | |
parent | 0f924547b0b94c68712dbdc29b14c1c063d1fda9 (diff) | |
download | FreeBSD-src-36c285d1286bd583e9d7ee6685013ab9058acfcc.zip FreeBSD-src-36c285d1286bd583e9d7ee6685013ab9058acfcc.tar.gz |
Unexpand two TAILQ_FOREACH_SAFE cases.
Ok'ed by: davidxu
Diffstat (limited to 'lib/libthr')
-rw-r--r-- | lib/libthr/thread/thr_list.c | 3 | ||||
-rw-r--r-- | lib/libthr/thread/thr_mutex.c | 3 |
2 files changed, 2 insertions, 4 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; diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index 5c47a73..0e3cebe 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -617,8 +617,7 @@ _mutex_unlock_private(pthread_t pthread) { struct pthread_mutex *m, *m_next; - for (m = TAILQ_FIRST(&pthread->mutexq); m != NULL; m = m_next) { - m_next = TAILQ_NEXT(m, m_qe); + TAILQ_FOREACH_SAFE(m, &pthread->mutexq, m_qe, m_next) { if ((m->m_flags & MUTEX_FLAGS_PRIVATE) != 0) _pthread_mutex_unlock(&m); } |