advapi32: Hold lock while handling service thread shutdown.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-08-17 09:36:59 +02:00 committed by Alexandre Julliard
parent 63c36da6da
commit 13bb213aeb
1 changed files with 5 additions and 2 deletions

View File

@ -625,8 +625,11 @@ static BOOL service_run_main_thread(void)
}
else if (ret < n)
{
services[wait_services[ret]]->thread = 0;
CloseHandle( wait_handles[ret] );
i = wait_services[ret];
EnterCriticalSection( &service_cs );
CloseHandle( services[i]->thread );
services[i]->thread = NULL;
LeaveCriticalSection( &service_cs );
}
else return FALSE;
}