From: Marc-Aurel Zent mzent@codeweavers.com
--- server/process.c | 2 +- server/thread.c | 9 +++++---- server/thread.h | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/server/process.c b/server/process.c index c877bb6f7ae..6af58cc2cc6 100644 --- a/server/process.c +++ b/server/process.c @@ -1641,7 +1641,7 @@ void set_process_priority( struct process *process, int priority )
LIST_FOR_EACH_ENTRY( thread, &process->thread_list, struct thread, proc_entry ) { - set_thread_priority( thread, priority, thread->priority ); + set_thread_priority( thread, thread->priority ); } }
diff --git a/server/thread.c b/server/thread.c index 9f6f5f57a52..b0573b609fd 100644 --- a/server/thread.c +++ b/server/thread.c @@ -784,8 +784,9 @@ static int get_base_priority( int priority_class, int priority ) #define THREAD_PRIORITY_REALTIME_HIGHEST 6 #define THREAD_PRIORITY_REALTIME_LOWEST -7
-unsigned int set_thread_priority( struct thread *thread, int priority_class, int priority ) +unsigned int set_thread_priority( struct thread *thread, int priority ) { + int priority_class = thread->process->priority; int max = THREAD_PRIORITY_HIGHEST; int min = THREAD_PRIORITY_LOWEST;
@@ -814,7 +815,7 @@ static void set_thread_info( struct thread *thread, { if (req->mask & SET_THREAD_INFO_PRIORITY) { - unsigned int status = set_thread_priority( thread, thread->process->priority, req->priority ); + unsigned int status = set_thread_priority( thread, req->priority ); if (status) set_error( status ); } if (req->mask & SET_THREAD_INFO_AFFINITY) @@ -1617,7 +1618,7 @@ DECL_HANDLER(init_first_thread) else set_thread_affinity( current, current->affinity );
- set_thread_priority( current, process->priority, current->priority ); + set_thread_priority( current, current->priority );
debug_level = max( debug_level, req->debug_level );
@@ -1648,7 +1649,7 @@ DECL_HANDLER(init_thread)
init_thread_context( current ); generate_debug_event( current, DbgCreateThreadStateChange, &req->entry ); - set_thread_priority( current, current->process->priority, current->priority ); + set_thread_priority( current, current->priority ); set_thread_affinity( current, current->affinity );
reply->suspend = (current->suspend || current->process->suspend || current->context != NULL); diff --git a/server/thread.h b/server/thread.h index 2b256be322f..7549243e88b 100644 --- a/server/thread.h +++ b/server/thread.h @@ -122,7 +122,7 @@ extern void thread_cancel_apc( struct thread *thread, struct object *owner, enum extern int thread_add_inflight_fd( struct thread *thread, int client, int server ); extern int thread_get_inflight_fd( struct thread *thread, int client ); extern struct token *thread_get_impersonation_token( struct thread *thread ); -extern unsigned int set_thread_priority( struct thread *thread, int priority_class, int priority ); +extern unsigned int set_thread_priority( struct thread *thread, int priority ); extern int set_thread_affinity( struct thread *thread, affinity_t affinity ); extern int suspend_thread( struct thread *thread ); extern int resume_thread( struct thread *thread );