Commit 341068aa authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

server: Delay setting system registers until suspending select is waken.

parent e5a9c256
...@@ -1706,7 +1706,13 @@ DECL_HANDLER(select) ...@@ -1706,7 +1706,13 @@ DECL_HANDLER(select)
else if (get_error() != STATUS_PENDING && get_reply_max_size() == sizeof(context_t) && else if (get_error() != STATUS_PENDING && get_reply_max_size() == sizeof(context_t) &&
current->context && current->suspend_cookie == req->cookie) current->context && current->suspend_cookie == req->cookie)
{ {
if (current->context->regs.flags) set_reply_data( &current->context->regs, sizeof(context_t) ); if (current->context->regs.flags)
{
unsigned int system_flags = get_context_system_regs(current->process->cpu) &
current->context->regs.flags;
if (system_flags) set_thread_context( current, &current->context->regs, system_flags );
set_reply_data( &current->context->regs, sizeof(context_t) );
}
release_object( current->context ); release_object( current->context );
current->context = NULL; current->context = NULL;
} }
...@@ -1896,14 +1902,13 @@ DECL_HANDLER(set_thread_context) ...@@ -1896,14 +1902,13 @@ DECL_HANDLER(set_thread_context)
else else
{ {
unsigned int system_flags = get_context_system_regs(context->cpu) & context->flags; unsigned int system_flags = get_context_system_regs(context->cpu) & context->flags;
unsigned int client_flags = context->flags & ~system_flags;
if (system_flags) set_thread_context( thread, context, system_flags ); if (thread != current) stop_thread( thread );
if (thread != current && !get_error()) stop_thread( thread ); else if (system_flags) set_thread_context( thread, context, system_flags );
if (thread->context && !get_error()) if (thread->context && !get_error())
{ {
copy_context( &thread->context->regs, context, context->flags ); copy_context( &thread->context->regs, context, context->flags );
thread->context->regs.flags |= client_flags; thread->context->regs.flags |= context->flags;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment