diff options
author | davidxu <davidxu@FreeBSD.org> | 2006-02-20 09:02:40 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2006-02-20 09:02:40 +0000 |
commit | 91fda076fb6ae70874d458cdbb7c5c213d821c54 (patch) | |
tree | 27a58ad0c9b9b9515b1bf5dc177718521b6e2529 /lib | |
parent | e94509aa302070c8eff68e6756652c71bb377d7b (diff) | |
download | FreeBSD-src-91fda076fb6ae70874d458cdbb7c5c213d821c54.zip FreeBSD-src-91fda076fb6ae70874d458cdbb7c5c213d821c54.tar.gz |
Read cycle count before sending signal, this fixes a userland thread
suspension bug.
MFC after: 3 days
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libthr/thread/thr_suspend_np.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libthr/thread/thr_suspend_np.c b/lib/libthr/thread/thr_suspend_np.c index cc424f9..7dbe539 100644 --- a/lib/libthr/thread/thr_suspend_np.c +++ b/lib/libthr/thread/thr_suspend_np.c @@ -126,10 +126,10 @@ suspend_common(struct pthread *curthread, struct pthread *thread, while (thread->state != PS_DEAD && !(thread->flags & THR_FLAGS_SUSPENDED)) { thread->flags |= THR_FLAGS_NEED_SUSPEND; + tmp = thread->cycle; THR_THREAD_UNLOCK(curthread, thread); _thr_send_sig(thread, SIGCANCEL); if (waitok) { - tmp = thread->cycle; _thr_umtx_wait(&thread->cycle, tmp, NULL); THR_THREAD_LOCK(curthread, thread); } else { |