Jacek Caban : server: Get rid of separate thread suspend_context.
Alexandre Julliard
julliard at winehq.org
Thu Apr 16 16:45:14 CDT 2020
Module: wine
Branch: master
Commit: 234fa118d4b8dd39c7992bace28e3d5ddb81453f
URL: https://source.winehq.org/git/wine.git/?a=commit;h=234fa118d4b8dd39c7992bace28e3d5ddb81453f
Author: Jacek Caban <jacek at codeweavers.com>
Date: Wed Apr 15 14:56:08 2020 +0200
server: Get rid of separate thread suspend_context.
It's always the same as context now.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
server/thread.c | 33 ++++++++++++++-------------------
server/thread.h | 3 +--
2 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/server/thread.c b/server/thread.c
index 863a7c18ba..9c22d83a9d 100644
--- a/server/thread.c
+++ b/server/thread.c
@@ -180,7 +180,6 @@ static inline void init_thread_structure( struct thread *thread )
thread->unix_pid = -1; /* not known yet */
thread->unix_tid = -1; /* not known yet */
thread->context = NULL;
- thread->suspend_context = NULL;
thread->teb = 0;
thread->entry_point = 0;
thread->debug_ctx = NULL;
@@ -325,7 +324,7 @@ static void cleanup_thread( struct thread *thread )
if (thread->request_fd) release_object( thread->request_fd );
if (thread->reply_fd) release_object( thread->reply_fd );
if (thread->wait_fd) release_object( thread->wait_fd );
- free( thread->suspend_context );
+ free( thread->context );
cleanup_clipboard_thread(thread);
destroy_thread_windows( thread );
free_msg_queue( thread );
@@ -345,7 +344,6 @@ static void cleanup_thread( struct thread *thread )
thread->reply_fd = NULL;
thread->wait_fd = NULL;
thread->context = NULL;
- thread->suspend_context = NULL;
thread->desktop = 0;
thread->desc = NULL;
thread->desc_len = 0;
@@ -775,14 +773,13 @@ static int send_thread_wakeup( struct thread *thread, client_ptr_t cookie, int s
int ret;
/* check if we're waking current suspend wait */
- if (thread->suspend_context && thread->suspend_cookie == cookie
+ if (thread->context && thread->suspend_cookie == cookie
&& signaled != STATUS_KERNEL_APC && signaled != STATUS_USER_APC)
{
- if (!thread->suspend_context->flags)
+ if (!thread->context->flags)
{
- if (current->context == current->suspend_context) thread->context = NULL;
- free( thread->suspend_context );
- thread->suspend_context = NULL;
+ free( thread->context );
+ thread->context = NULL;
}
else signaled = STATUS_KERNEL_APC; /* signal a fake APC so that client calls select to get a new context */
}
@@ -1560,10 +1557,9 @@ DECL_HANDLER(select)
return;
}
- if (!(current->suspend_context = mem_alloc( sizeof(*context) ))) return;
- memcpy( current->suspend_context, context, sizeof(*context) );
- current->suspend_context->flags = 0; /* to keep track of what is modified */
- current->context = current->suspend_context;
+ if (!(current->context = mem_alloc( sizeof(*context) ))) return;
+ memcpy( current->context, context, sizeof(*context) );
+ current->context->flags = 0; /* to keep track of what is modified */
current->suspend_cookie = req->cookie;
}
@@ -1635,15 +1631,14 @@ DECL_HANDLER(select)
}
release_object( apc );
}
- else if(get_error() != STATUS_PENDING && get_reply_max_size() == sizeof(context_t)
- && current->suspend_context && current->suspend_cookie == req->cookie)
+ else if (get_error() != STATUS_PENDING && get_reply_max_size() == sizeof(context_t) &&
+ current->context && current->suspend_cookie == req->cookie)
{
- if (current->suspend_context->flags)
- set_reply_data_ptr( current->suspend_context, sizeof(context_t) );
+ if (current->context->flags)
+ set_reply_data_ptr( current->context, sizeof(context_t) );
else
- free( current->suspend_context );
- if (current->context == current->suspend_context) current->context = NULL;
- current->suspend_context = NULL;
+ free( current->context );
+ current->context = NULL;
}
}
diff --git a/server/thread.h b/server/thread.h
index 4b9304fe13..b86d8d3dbe 100644
--- a/server/thread.h
+++ b/server/thread.h
@@ -75,8 +75,7 @@ struct thread
int exit_code; /* thread exit code */
int unix_pid; /* Unix pid of client */
int unix_tid; /* Unix tid of client */
- context_t *context; /* current context if in an exception handler */
- context_t *suspend_context; /* current context if suspended */
+ context_t *context; /* current context */
client_ptr_t suspend_cookie;/* wait cookie of suspending select */
client_ptr_t teb; /* TEB address (in client address space) */
client_ptr_t entry_point; /* entry point (in client address space) */
More information about the wine-cvs
mailing list