mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-03 01:51:48 +00:00
server: Only keep the running processes in the global process list.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
fdf6d7de2e
commit
d316d548c2
|
@ -4231,7 +4231,6 @@ static void test_dead_process(void)
|
||||||
}
|
}
|
||||||
offset += spi->NextEntryOffset;
|
offset += spi->NextEntryOffset;
|
||||||
} while (spi->NextEntryOffset);
|
} while (spi->NextEntryOffset);
|
||||||
todo_wine
|
|
||||||
ok( !found, "process still enumerated\n" );
|
ok( !found, "process still enumerated\n" );
|
||||||
CloseHandle(pi.hProcess);
|
CloseHandle(pi.hProcess);
|
||||||
CloseHandle(pi.hThread);
|
CloseHandle(pi.hThread);
|
||||||
|
|
|
@ -649,8 +649,7 @@ static int propagate_console_signal_cb(struct process *process, void *user)
|
||||||
{
|
{
|
||||||
struct console_signal_info* csi = (struct console_signal_info*)user;
|
struct console_signal_info* csi = (struct console_signal_info*)user;
|
||||||
|
|
||||||
if (process->console == csi->console && process->running_threads &&
|
if (process->console == csi->console && (!csi->group || process->group_id == csi->group))
|
||||||
(!csi->group || process->group_id == csi->group))
|
|
||||||
{
|
{
|
||||||
/* find a suitable thread to signal */
|
/* find a suitable thread to signal */
|
||||||
struct thread *thread;
|
struct thread *thread;
|
||||||
|
|
|
@ -559,7 +559,6 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
|
||||||
list_init( &process->rawinput_devices );
|
list_init( &process->rawinput_devices );
|
||||||
|
|
||||||
process->end_time = 0;
|
process->end_time = 0;
|
||||||
list_add_tail( &process_list, &process->entry );
|
|
||||||
|
|
||||||
if (sd && !default_set_sd( &process->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
|
if (sd && !default_set_sd( &process->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
|
||||||
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION ))
|
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION ))
|
||||||
|
@ -646,7 +645,6 @@ static void process_destroy( struct object *obj )
|
||||||
}
|
}
|
||||||
if (process->console) release_object( process->console );
|
if (process->console) release_object( process->console );
|
||||||
if (process->msg_fd) release_object( process->msg_fd );
|
if (process->msg_fd) release_object( process->msg_fd );
|
||||||
list_remove( &process->entry );
|
|
||||||
if (process->idle_event) release_object( process->idle_event );
|
if (process->idle_event) release_object( process->idle_event );
|
||||||
if (process->id) free_ptid( process->id );
|
if (process->id) free_ptid( process->id );
|
||||||
if (process->token) release_object( process->token );
|
if (process->token) release_object( process->token );
|
||||||
|
@ -804,15 +802,11 @@ restart:
|
||||||
/* kill all processes */
|
/* kill all processes */
|
||||||
static void kill_all_processes(void)
|
static void kill_all_processes(void)
|
||||||
{
|
{
|
||||||
for (;;)
|
struct list *ptr;
|
||||||
{
|
|
||||||
struct process *process;
|
|
||||||
|
|
||||||
LIST_FOR_EACH_ENTRY( process, &process_list, struct process, entry )
|
while ((ptr = list_head( &process_list )))
|
||||||
{
|
{
|
||||||
if (process->running_threads) break;
|
struct process *process = LIST_ENTRY( ptr, struct process, entry );
|
||||||
}
|
|
||||||
if (&process->entry == &process_list) break; /* no process found */
|
|
||||||
terminate_process( process, NULL, 1 );
|
terminate_process( process, NULL, 1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -828,7 +822,6 @@ void kill_console_processes( struct thread *renderer, int exit_code )
|
||||||
LIST_FOR_EACH_ENTRY( process, &process_list, struct process, entry )
|
LIST_FOR_EACH_ENTRY( process, &process_list, struct process, entry )
|
||||||
{
|
{
|
||||||
if (process == renderer->process) continue;
|
if (process == renderer->process) continue;
|
||||||
if (!process->running_threads) continue;
|
|
||||||
if (process->console && console_get_renderer( process->console ) == renderer) break;
|
if (process->console && console_get_renderer( process->console ) == renderer) break;
|
||||||
}
|
}
|
||||||
if (&process->entry == &process_list) break; /* no process found */
|
if (&process->entry == &process_list) break; /* no process found */
|
||||||
|
@ -875,6 +868,7 @@ void add_process_thread( struct process *process, struct thread *thread )
|
||||||
list_add_tail( &process->thread_list, &thread->proc_entry );
|
list_add_tail( &process->thread_list, &thread->proc_entry );
|
||||||
if (!process->running_threads++)
|
if (!process->running_threads++)
|
||||||
{
|
{
|
||||||
|
list_add_tail( &process_list, &process->entry );
|
||||||
running_processes++;
|
running_processes++;
|
||||||
if (!process->is_system)
|
if (!process->is_system)
|
||||||
{
|
{
|
||||||
|
@ -901,6 +895,7 @@ void remove_process_thread( struct process *process, struct thread *thread )
|
||||||
/* we have removed the last running thread, exit the process */
|
/* we have removed the last running thread, exit the process */
|
||||||
process->exit_code = thread->exit_code;
|
process->exit_code = thread->exit_code;
|
||||||
generate_debug_event( thread, DbgExitProcessStateChange, process );
|
generate_debug_event( thread, DbgExitProcessStateChange, process );
|
||||||
|
list_remove( &process->entry );
|
||||||
process_killed( process );
|
process_killed( process );
|
||||||
}
|
}
|
||||||
else generate_debug_event( thread, DbgExitThreadStateChange, thread );
|
else generate_debug_event( thread, DbgExitThreadStateChange, thread );
|
||||||
|
@ -979,10 +974,8 @@ void detach_debugged_processes( struct debug_obj *debug_obj, int exit_code )
|
||||||
|
|
||||||
/* find the first process being debugged by 'debugger' and still running */
|
/* find the first process being debugged by 'debugger' and still running */
|
||||||
LIST_FOR_EACH_ENTRY( process, &process_list, struct process, entry )
|
LIST_FOR_EACH_ENTRY( process, &process_list, struct process, entry )
|
||||||
{
|
|
||||||
if (!process->running_threads) continue;
|
|
||||||
if (process->debug_obj == debug_obj) break;
|
if (process->debug_obj == debug_obj) break;
|
||||||
}
|
|
||||||
if (&process->entry == &process_list) break; /* no process found */
|
if (&process->entry == &process_list) break; /* no process found */
|
||||||
if (exit_code)
|
if (exit_code)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue