* wait_for_child() now behaves correctly when waiting for children of a specific
process group. This fixes bug #996. * As a result, the process group stuff and wait_for_child() got much simpler; get_death_entry() and update_wait_for_any() could go away completely. * If a team goes away, all of its children are now "reparented" to the kernel team, instead of the team's parent - this follows common implementations (and POSIX if I understand it correctly), but not BeOS anymore. The OpenGroup Base says this about this topic: "If a parent process terminates without waiting for all of its child processes to terminate, the remaining child processes shall be assigned a new parent process ID corresponding to an implementation-defined system process." * We wait too long in wait_test_4 which at least puts us on par with Linux; see comment in _user_setpgid(). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20010 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2004-2006, Haiku Inc.
|
||||
* Copyright 2004-2007, Haiku Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Thread definition and structures
|
||||
@@ -48,7 +48,7 @@ struct image;
|
||||
|
||||
struct death_entry {
|
||||
struct list_link link;
|
||||
team_id team;
|
||||
pid_t group_id;
|
||||
thread_id thread;
|
||||
status_t status;
|
||||
uint16 reason;
|
||||
@@ -61,19 +61,16 @@ struct process_session {
|
||||
};
|
||||
|
||||
struct process_group {
|
||||
struct process_group *next; // next in hash
|
||||
struct process_group *next; // next in hash
|
||||
struct process_session *session;
|
||||
pid_t id;
|
||||
sem_id dead_child_sem;
|
||||
int32 wait_for_any;
|
||||
int32 dead_child_waiters; // count of threads waiting for sem
|
||||
struct team *teams;
|
||||
};
|
||||
|
||||
struct team_loading_info {
|
||||
struct thread *thread; // the waiting thread
|
||||
status_t result; // the result of the loading
|
||||
bool done; // set when loading is done/aborted
|
||||
struct thread *thread; // the waiting thread
|
||||
status_t result; // the result of the loading
|
||||
bool done; // set when loading is done/aborted
|
||||
};
|
||||
|
||||
struct team_watcher {
|
||||
|
||||
Reference in New Issue
Block a user