[PATCH 0/1] MR7310: server: Don't fail SetThreadPriority() on terminated threads
Fixes: 0559442de9c139ec2b66fee69f87a58b60df4b10 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57824 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7310
From: Jinoh Kang <jinoh.kang.kr(a)gmail.com> Fixes: 0559442de9c139ec2b66fee69f87a58b60df4b10 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=57824 --- server/thread.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/server/thread.c b/server/thread.c index 88b953709ef..3c7e4541a09 100644 --- a/server/thread.c +++ b/server/thread.c @@ -682,13 +682,11 @@ unsigned int set_thread_priority( struct thread *thread, int priority_class, int priority != THREAD_PRIORITY_TIME_CRITICAL) return STATUS_INVALID_PARAMETER; - if (thread->state == TERMINATED) - return STATUS_THREAD_IS_TERMINATING; - thread->priority = priority; /* if thread is gone or hasn't started yet, this will be called again from init_thread with a unix_tid */ - if (thread->unix_tid != -1) apply_thread_priority( thread, get_base_priority( priority_class, priority )); + if (thread->state == RUNNING && thread->unix_tid != -1) + apply_thread_priority( thread, get_base_priority( priority_class, priority )); return STATUS_SUCCESS; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/7310
participants (2)
-
Jinoh Kang -
Jinoh Kang (@iamahuman)