From 91fda076fb6ae70874d458cdbb7c5c213d821c54 Mon Sep 17 00:00:00 2001 From: davidxu Date: Mon, 20 Feb 2006 09:02:40 +0000 Subject: [PATCH] Read cycle count before sending signal, this fixes a userland thread suspension bug. MFC after: 3 days --- lib/libthr/thread/thr_suspend_np.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libthr/thread/thr_suspend_np.c b/lib/libthr/thread/thr_suspend_np.c index cc424f91c202..7dbe539330f7 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 {