From f6662576e37d300436ea4bfd8377b813c5d1f7d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Gouget?= Date: Tue, 2 Apr 2002 02:53:45 +0000 Subject: [PATCH] Don't suspend a terminated thread. --- server/thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/thread.c b/server/thread.c index cf5dcf87b9d..7e019fabbd0 100644 --- a/server/thread.c +++ b/server/thread.c @@ -905,7 +905,8 @@ DECL_HANDLER(suspend_thread) if ((thread = get_thread_from_handle( req->handle, THREAD_SUSPEND_RESUME ))) { - reply->count = suspend_thread( thread, 1 ); + if (thread->state == TERMINATED) set_error( STATUS_ACCESS_DENIED ); + else reply->count = suspend_thread( thread, 1 ); release_object( thread ); } } @@ -917,7 +918,8 @@ DECL_HANDLER(resume_thread) if ((thread = get_thread_from_handle( req->handle, THREAD_SUSPEND_RESUME ))) { - reply->count = resume_thread( thread ); + if (thread->state == TERMINATED) set_error( STATUS_ACCESS_DENIED ); + else reply->count = resume_thread( thread ); release_object( thread ); } }