diff options
author | davidxu <davidxu@FreeBSD.org> | 2010-09-25 04:21:31 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2010-09-25 04:21:31 +0000 |
commit | 2aedc66f1220dcc147eceb6cfe800aea0d722adf (patch) | |
tree | 825571259ca2c5332b2089d8e4ad2ec6e76708a2 /lib/libthr | |
parent | 74604ed9c419ab380cacaaeb78e4c26f9f37e0ad (diff) | |
download | FreeBSD-src-2aedc66f1220dcc147eceb6cfe800aea0d722adf.zip FreeBSD-src-2aedc66f1220dcc147eceb6cfe800aea0d722adf.tar.gz |
Simplify code, and in while loop, fix operator to match the unwinding
direction.
Diffstat (limited to 'lib/libthr')
-rw-r--r-- | lib/libthr/thread/thr_exit.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libthr/thread/thr_exit.c b/lib/libthr/thread/thr_exit.c index 5cc3a35..67026b2 100644 --- a/lib/libthr/thread/thr_exit.c +++ b/lib/libthr/thread/thr_exit.c @@ -140,17 +140,14 @@ thread_unwind_stop(int version, _Unwind_Action actions, /* XXX assume stack grows down to lower address */ cfa = _Unwind_GetCFA(context); - if (actions & _UA_END_OF_STACK) { - done = 1; - } else if (cfa >= (uintptr_t)curthread->unwind_stackend) { + if (actions & _UA_END_OF_STACK || + cfa >= (uintptr_t)curthread->unwind_stackend) { done = 1; } while ((cur = curthread->cleanup) != NULL && - (done || - ((uintptr_t)cur < (uintptr_t)curthread->unwind_stackend && - (uintptr_t)cur >= cfa))) { - __pthread_cleanup_pop_imp(1); + (done || (uintptr_t)cur <= cfa)) { + __pthread_cleanup_pop_imp(1); } if (done) |