Added a team watching mechanism in the kernel, not yet tested (but at least doesn't cause any harm yet :-)).

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13888 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2005-08-03 12:00:42 +00:00
parent 9ecb61a8f6
commit 99c566f6c9
3 changed files with 106 additions and 4 deletions
+3
View File
@@ -32,6 +32,9 @@ struct team *team_get_team_struct_locked(team_id id);
int32 team_max_teams(void);
int32 team_used_teams(void);
status_t start_watching_team(team_id team, void (*hook)(team_id, void *), void *data);
status_t stop_watching_team(team_id team, void (*hook)(team_id, void *), void *data);
// used in syscalls.c
thread_id _user_load_image(int32 argCount, const char **args, int32 envCount,
const char **envp, int32 priority, uint32 flags);
+7
View File
@@ -78,6 +78,12 @@ struct team_loading_info {
bool done; // set when loading is done/aborted
};
struct team_watcher {
struct list_link link;
void (*hook)(team_id team, void *data);
void *data;
};
#define MAX_DEAD_CHILDREN 32
// this is a soft limit for the number of dead entries in a team
@@ -111,6 +117,7 @@ struct team {
struct thread *thread_list;
struct team_loading_info *loading_info;
struct list image_list;
struct list watcher_list;
struct arch_team arch_info;
struct team_debug_info debug_info;