Lines Matching refs:team
101 void Notify(uint32 eventCode, Team* team);
200 Team* team = sTeamHash.NextElement(&fEntry); in Next() local
201 if (team != NULL) in Next()
202 team->AcquireReference(); in Next()
204 return team; in Next()
308 SetJobControlState(team_id team, job_control_state newState, Signal* signal) in SetJobControlState() argument
310 fTeam(team), in SetJobControlState()
412 TeamNotificationService::Notify(uint32 eventCode, Team* team) in Notify() argument
418 event.AddInt32("team", team->id); in Notify()
419 event.AddPointer("teamStruct", team); in Notify()
459 job_control_entry->team = this; in Team()
557 Team* team = new(std::nothrow) Team(id, kernel); in Create() local
558 if (team == NULL) in Create()
560 ObjectDeleter<Team> teamDeleter(team); in Create()
563 team->SetName(name); in Create()
566 if (team->job_control_entry == NULL || team->fQueuedSignalsCounter == NULL) in Create()
570 if (arch_team_init_team_struct(team, kernel) != B_OK) in Create()
574 status_t error = user_timer_create_team_timers(team); in Create()
579 team->start_time = system_time(); in Create()
594 Team* team = thread_get_current_thread()->team; in Get() local
595 team->AcquireReference(); in Get()
596 return team; in Get()
600 Team* team = sTeamHash.Lookup(id); in Get() local
601 if (team != NULL) in Get()
602 team->AcquireReference(); in Get()
603 return team; in Get()
615 Team* team = Get(id); in GetAndLock() local
616 if (team == NULL) in GetAndLock()
620 team->Lock(); in GetAndLock()
623 if (team->state >= TEAM_STATE_SHUTDOWN) { in GetAndLock()
624 team->Unlock(); in GetAndLock()
625 team->ReleaseReference(); in GetAndLock()
629 return team; in GetAndLock()
1080 Team* team = teams; in IsOrphaned() local
1081 while (orphaned && team != NULL) { in IsOrphaned()
1082 team->LockTeamAndParent(false); in IsOrphaned()
1084 Team* parent = team->parent; in IsOrphaned()
1090 team->UnlockTeamAndParent(); in IsOrphaned()
1092 team = team->group_next; in IsOrphaned()
1143 _dump_team_info(Team* team) in _dump_team_info() argument
1145 kprintf("TEAM: %p\n", team); in _dump_team_info()
1146 kprintf("id: %" B_PRId32 " (%#" B_PRIx32 ")\n", team->id, in _dump_team_info()
1147 team->id); in _dump_team_info()
1148 kprintf("serial_number: %" B_PRId64 "\n", team->serial_number); in _dump_team_info()
1149 kprintf("name: '%s'\n", team->Name()); in _dump_team_info()
1150 kprintf("args: '%s'\n", team->Args()); in _dump_team_info()
1151 kprintf("hash_next: %p\n", team->hash_next); in _dump_team_info()
1152 kprintf("parent: %p", team->parent); in _dump_team_info()
1153 if (team->parent != NULL) { in _dump_team_info()
1154 kprintf(" (id = %" B_PRId32 ")\n", team->parent->id); in _dump_team_info()
1158 kprintf("children: %p\n", team->children); in _dump_team_info()
1159 kprintf("num_threads: %d\n", team->num_threads); in _dump_team_info()
1160 kprintf("state: %d\n", team->state); in _dump_team_info()
1161 kprintf("flags: 0x%" B_PRIx32 "\n", team->flags); in _dump_team_info()
1162 kprintf("io_context: %p\n", team->io_context); in _dump_team_info()
1163 if (team->address_space) in _dump_team_info()
1164 kprintf("address_space: %p\n", team->address_space); in _dump_team_info()
1166 (void*)team->user_data, team->user_data_area); in _dump_team_info()
1167 kprintf("free user thread: %p\n", team->free_user_threads); in _dump_team_info()
1168 kprintf("main_thread: %p\n", team->main_thread); in _dump_team_info()
1169 kprintf("thread_list: %p\n", team->thread_list); in _dump_team_info()
1170 kprintf("group_id: %" B_PRId32 "\n", team->group_id); in _dump_team_info()
1171 kprintf("session_id: %" B_PRId32 "\n", team->session_id); in _dump_team_info()
1183 if (thread != NULL && thread->team != NULL) in dump_team_info()
1184 _dump_team_info(thread->team); in dump_team_info()
1199 Team* team = it.Next();) { in dump_team_info()
1200 if ((team->Name() && strcmp(argv[1], team->Name()) == 0) in dump_team_info()
1201 || team->id == (team_id)arg) { in dump_team_info()
1202 _dump_team_info(team); in dump_team_info()
1221 Team* team = it.Next();) { in dump_teams()
1222 kprintf("%p%7" B_PRId32 " %p %s\n", team, team->id, team->parent, team->Name()); in dump_teams()
1247 Team* team = thread_get_current_thread()->team; in _getppid() local
1248 TeamLocker teamLocker(team); in _getppid()
1249 if (team->parent == NULL) { in _getppid()
1253 return team->parent->id; in _getppid()
1256 Team* team = Team::GetAndLock(id); in _getppid() local
1257 if (team == NULL) { in _getppid()
1264 if (team->parent == NULL) { in _getppid()
1268 parentID = team->parent->id; in _getppid()
1270 team->UnlockAndReleaseReference(); in _getppid()
1284 insert_team_into_parent(Team* parent, Team* team) in insert_team_into_parent() argument
1288 team->siblings_next = parent->children; in insert_team_into_parent()
1289 parent->children = team; in insert_team_into_parent()
1290 team->parent = parent; in insert_team_into_parent()
1302 remove_team_from_parent(Team* parent, Team* team) in remove_team_from_parent() argument
1309 if (child == team) { in remove_team_from_parent()
1315 team->parent = NULL; in remove_team_from_parent()
1327 is_session_leader(Team* team) in is_session_leader() argument
1329 return team->session_id == team->id; in is_session_leader()
1337 is_process_group_leader(Team* team) in is_process_group_leader() argument
1339 return team->group_id == team->id; in is_process_group_leader()
1348 insert_team_into_group(ProcessGroup* group, Team* team) in insert_team_into_group() argument
1350 team->group = group; in insert_team_into_group()
1351 team->group_id = group->id; in insert_team_into_group()
1352 team->session_id = group->Session()->id; in insert_team_into_group()
1354 team->group_next = group->teams; in insert_team_into_group()
1355 group->teams = team; in insert_team_into_group()
1368 remove_team_from_group(Team* team) in remove_team_from_group() argument
1370 ProcessGroup* group = team->group; in remove_team_from_group()
1380 if (current == team) { in remove_team_from_group()
1391 team->group = NULL; in remove_team_from_group()
1392 team->group_next = NULL; in remove_team_from_group()
1393 team->group_id = -1; in remove_team_from_group()
1400 create_team_user_data(Team* team, void* exactAddress = NULL) in create_team_user_data() argument
1413 status_t result = vm_reserve_address_range(team->id, &address, addressSpec, in create_team_user_data()
1429 team->user_data_area = create_area_etc(team->id, "user area", in create_team_user_data()
1433 if (team->user_data_area < 0) in create_team_user_data()
1434 return team->user_data_area; in create_team_user_data()
1436 team->user_data = (addr_t)address; in create_team_user_data()
1437 team->used_user_data = 0; in create_team_user_data()
1438 team->user_data_size = kTeamUserDataInitialSize; in create_team_user_data()
1439 team->free_user_threads = NULL; in create_team_user_data()
1446 delete_team_user_data(Team* team) in delete_team_user_data() argument
1448 if (team->user_data_area >= 0) { in delete_team_user_data()
1449 vm_delete_area(team->id, team->user_data_area, true); in delete_team_user_data()
1450 vm_unreserve_address_range(team->id, (void*)team->user_data, in delete_team_user_data()
1453 team->user_data = 0; in delete_team_user_data()
1454 team->used_user_data = 0; in delete_team_user_data()
1455 team->user_data_size = 0; in delete_team_user_data()
1456 team->user_data_area = -1; in delete_team_user_data()
1457 while (free_user_thread* entry = team->free_user_threads) { in delete_team_user_data()
1458 team->free_user_threads = entry->next; in delete_team_user_data()
1579 Team* team; in team_create_thread_start_internal() local
1589 team = thread->team; in team_create_thread_start_internal()
1646 team->Lock(); in team_create_thread_start_internal()
1647 team->state = TEAM_STATE_NORMAL; in team_create_thread_start_internal()
1648 team->Unlock(); in team_create_thread_start_internal()
1651 area_id commPageArea = clone_commpage_area(team->id, in team_create_thread_start_internal()
1652 &team->commpage_address); in team_create_thread_start_internal()
1668 imageInfo.basic_info.text = team->commpage_address; in team_create_thread_start_internal()
1669 imageInfo.text_delta = (ssize_t)(addr_t)team->commpage_address; in team_create_thread_start_internal()
1673 image_id image = register_image(team, &imageInfo, sizeof(imageInfo)); in team_create_thread_start_internal()
1697 err = elf_load_user_image(runtimeLoaderPath.Path(), team, 0, in team_create_thread_start_internal()
1714 programArgs, team->commpage_address); in team_create_thread_start_internal()
1722 team_init_exit_info_on_error(thread_get_current_thread()->team); in team_create_thread_start()
1767 Team* team = Team::Create(mainThread->id, path, false); in load_image_internal() local
1768 if (team == NULL) in load_image_internal()
1770 BReference<Team> teamReference(team, true); in load_image_internal()
1774 loadingInfo.condition.Init(team, "image load"); in load_image_internal()
1777 team->loading_info = &loadingInfo; in load_image_internal()
1788 team->Lock(); in load_image_internal()
1791 inherit_parent_user_and_group(team, parent); in load_image_internal()
1797 team->Unlock(); in load_image_internal()
1801 update_set_id_user_and_group(team, path); in load_image_internal()
1811 team->SetArgs(path, teamArgs->flat_args + 1, argCount - 1); in load_image_internal()
1814 team->io_context = vfs_new_io_context(parentIOContext, true); in load_image_internal()
1815 if (!team->io_context) { in load_image_internal()
1825 vfs_exec_io_context(team->io_context); in load_image_internal()
1828 status = VMAddressSpace::Create(team->id, USER_BASE, USER_SIZE, false, in load_image_internal()
1829 &team->address_space); in load_image_internal()
1833 team->address_space->SetRandomizingEnabled( in load_image_internal()
1837 status = create_team_user_data(team); in load_image_internal()
1843 team->Lock(); in load_image_internal()
1848 sTeamHash.Insert(team); in load_image_internal()
1854 insert_team_into_parent(parent, team); in load_image_internal()
1855 insert_team_into_group(parent->group, team); in load_image_internal()
1857 team->Unlock(); in load_image_internal()
1861 sNotificationService.Notify(TEAM_ADDED, team); in load_image_internal()
1870 teamID = team->id; in load_image_internal()
1909 team->Lock(); in load_image_internal()
1910 if (team->loading_info != NULL) in load_image_internal()
1912 team->Unlock(); in load_image_internal()
1925 team->Lock(); in load_image_internal()
1927 remove_team_from_group(team); in load_image_internal()
1928 remove_team_from_parent(team->parent, team); in load_image_internal()
1930 team->Unlock(); in load_image_internal()
1935 sTeamHash.Remove(team); in load_image_internal()
1940 sNotificationService.Notify(TEAM_REMOVED, team); in load_image_internal()
1942 delete_team_user_data(team); in load_image_internal()
1944 team->address_space->Put(); in load_image_internal()
1968 Team* team = thread_get_current_thread()->team; in exec_team() local
1975 team->id)); in exec_team()
1980 if (team == team_get_kernel_team()) in exec_team()
1987 if (currentThread != team->main_thread) in exec_team()
1993 TeamLocker teamLocker(team); in exec_team()
1994 InterruptsSpinLocker debugInfoLocker(team->debug_info.lock); in exec_team()
1996 if (team->debug_info.flags & B_TEAM_DEBUG_DEBUGGER_INSTALLED) in exec_team()
1997 nubThreadID = team->debug_info.nub_thread; in exec_team()
2001 for (Thread* thread = team->thread_list; thread != NULL; in exec_team()
2003 if (thread != team->main_thread && thread->id != nubThreadID) in exec_team()
2007 team->DeleteUserTimers(true); in exec_team()
2008 team->ResetSignalsOnExec(); in exec_team()
2020 team->SetArgs(path, teamArgs->flat_args + 1, argCount - 1); in exec_team()
2029 delete_team_user_data(team); in exec_team()
2030 vm_delete_areas(team->address_space, false); in exec_team()
2031 xsi_sem_undo(team); in exec_team()
2032 delete_owned_ports(team); in exec_team()
2033 sem_delete_owned_sems(team); in exec_team()
2034 remove_images(team); in exec_team()
2035 vfs_exec_io_context(team->io_context); in exec_team()
2036 delete_user_mutex_context(team->user_mutex_context); in exec_team()
2037 team->user_mutex_context = NULL; in exec_team()
2038 delete_realtime_sem_context(team->realtime_sem_context); in exec_team()
2039 team->realtime_sem_context = NULL; in exec_team()
2042 team->address_space->SetRandomizingEnabled( in exec_team()
2045 status = create_team_user_data(team); in exec_team()
2057 team->Lock(); in exec_team()
2058 team->SetName(path); in exec_team()
2059 team->Unlock(); in exec_team()
2069 atomic_or(&team->flags, TEAM_FLAG_EXEC_DONE); in exec_team()
2073 update_set_id_user_and_group(team, path); in exec_team()
2078 sNotificationService.Notify(TEAM_EXEC, team); in exec_team()
2081 user_thread* userThread = team_allocate_user_thread(team); in exec_team()
2088 status = thread_create_user_stack(currentThread->team, currentThread, NULL, in exec_team()
2111 Team* parentTeam = parentThread->team; in fork_team()
2112 Team* team; in fork_team() local
2137 team = Team::Create(thread->id, NULL, false); in fork_team()
2138 if (team == NULL) in fork_team()
2142 team->Lock(); in fork_team()
2144 team->SetName(parentTeam->Name()); in fork_team()
2145 team->SetArgs(parentTeam->Args()); in fork_team()
2147 team->commpage_address = parentTeam->commpage_address; in fork_team()
2150 inherit_parent_user_and_group(team, parentTeam); in fork_team()
2153 team->InheritSignalActions(parentTeam); in fork_team()
2155 team->Unlock(); in fork_team()
2159 team->debug_info.flags |= atomic_get(&parentTeam->debug_info.flags) in fork_team()
2169 team->io_context = vfs_new_io_context(parentTeam->io_context, false); in fork_team()
2170 if (!team->io_context) { in fork_team()
2177 team->realtime_sem_context = clone_realtime_sem_context( in fork_team()
2179 if (team->realtime_sem_context == NULL) { in fork_team()
2186 status = VMAddressSpace::Create(team->id, USER_BASE, USER_SIZE, false, in fork_team()
2187 &team->address_space); in fork_team()
2199 status = create_team_user_data(team, info.address); in fork_team()
2203 thread->user_thread = team_allocate_user_thread(team); in fork_team()
2206 area_id area = vm_copy_area(team->address_space->ID(), info.name, in fork_team()
2241 if (copy_images(parentTeam->id, team) != B_OK) in fork_team()
2246 team->Lock(); in fork_team()
2251 sTeamHash.Insert(team); in fork_team()
2257 insert_team_into_parent(parentTeam, team); in fork_team()
2258 insert_team_into_group(parentTeam->group, team); in fork_team()
2260 team->Unlock(); in fork_team()
2264 sNotificationService.Notify(TEAM_ADDED, team); in fork_team()
2274 parentThread->name, parentThread->priority, NULL, team->id, thread); in fork_team()
2285 user_debug_team_created(team->id); in fork_team()
2296 team->Lock(); in fork_team()
2298 remove_team_from_group(team); in fork_team()
2299 remove_team_from_parent(team->parent, team); in fork_team()
2301 team->Unlock(); in fork_team()
2306 sTeamHash.Remove(team); in fork_team()
2311 sNotificationService.Notify(TEAM_REMOVED, team); in fork_team()
2313 remove_images(team); in fork_team()
2315 team->address_space->RemoveAndPut(); in fork_team()
2317 delete_realtime_sem_context(team->realtime_sem_context); in fork_team()
2321 team->ReleaseReference(); in fork_team()
2371 = (entry->team ? entry->team->group_id : entry->group_id); in get_job_control_entry()
2402 get_job_control_entry(Team* team, pid_t id, uint32 flags) in get_job_control_entry() argument
2407 entry = get_job_control_entry(team->dead_children, id); in get_job_control_entry()
2410 entry = get_job_control_entry(team->continued_children, id); in get_job_control_entry()
2413 entry = get_job_control_entry(team->stopped_children, id); in get_job_control_entry()
2453 if (team != NULL) { in InitDeadState()
2454 ASSERT(team->exit.initialized); in InitDeadState()
2456 group_id = team->group_id; in InitDeadState()
2457 team->group->AcquireReference(); in InitDeadState()
2460 thread = team->id; in InitDeadState()
2461 status = team->exit.status; in InitDeadState()
2462 reason = team->exit.reason; in InitDeadState()
2463 signal = team->exit.signal; in InitDeadState()
2464 signaling_user = team->exit.signaling_user; in InitDeadState()
2465 user_time = team->dead_threads_user_time in InitDeadState()
2466 + team->dead_children.user_time; in InitDeadState()
2467 kernel_time = team->dead_threads_kernel_time in InitDeadState()
2468 + team->dead_children.kernel_time; in InitDeadState()
2470 team = NULL; in InitDeadState()
2483 team = other.team; in operator =()
2501 Team* team = thread->team; in wait_for_child() local
2523 TeamLocker teamLocker(team); in wait_for_child()
2527 child = originalChild == 0 ? -team->group_id : originalChild; in wait_for_child()
2530 job_control_entry* entry = get_job_control_entry(team, child, flags); in wait_for_child()
2539 childrenExist = team->children != NULL; in wait_for_child()
2541 childrenExist = has_children_in_group(team, -child); in wait_for_child()
2542 } else if (child != team->id) { in wait_for_child()
2546 childrenExist = childTeam->parent == team; in wait_for_child()
2566 team->dead_children.entries.Remove(entry); in wait_for_child()
2567 team->dead_children.count--; in wait_for_child()
2570 team_set_job_control_state(entry->team, in wait_for_child()
2581 team->dead_children.condition_variable.Add(&deadWaitEntry); in wait_for_child()
2614 struct sigaction& handler = team->SignalActionFor(SIGCHLD); in wait_for_child()
2659 TeamLocker teamLocker(team); in wait_for_child()
2660 InterruptsSpinLocker signalLocker(team->signal_lock); in wait_for_child()
2663 if (is_team_signal_blocked(team, SIGCHLD)) { in wait_for_child()
2664 if (get_job_control_entry(team, child, flags) == NULL) in wait_for_child()
2665 team->RemovePendingSignals(SIGNAL_TO_MASK(SIGCHLD)); in wait_for_child()
2688 fill_team_info(Team* team, team_info* info, size_t size) in fill_team_info() argument
2696 info->team = team->id; in fill_team_info()
2698 info->image_count = count_images(team); in fill_team_info()
2701 TeamLocker teamLocker(team); in fill_team_info()
2702 InterruptsSpinLocker debugInfoLocker(team->debug_info.lock); in fill_team_info()
2704 info->thread_count = team->num_threads; in fill_team_info()
2706 info->debugger_nub_thread = team->debug_info.nub_thread; in fill_team_info()
2707 info->debugger_nub_port = team->debug_info.nub_port; in fill_team_info()
2708 info->uid = team->effective_uid; in fill_team_info()
2709 info->gid = team->effective_gid; in fill_team_info()
2711 strlcpy(info->args, team->Args(), sizeof(info->args)); in fill_team_info()
2715 info->real_uid = team->real_uid; in fill_team_info()
2716 info->real_gid = team->real_gid; in fill_team_info()
2717 info->group_id = team->group_id; in fill_team_info()
2718 info->session_id = team->session_id; in fill_team_info()
2720 if (team->parent != NULL) in fill_team_info()
2721 info->parent = team->parent->id; in fill_team_info()
2725 strlcpy(info->name, team->Name(), sizeof(info->name)); in fill_team_info()
2726 info->start_time = team->start_time; in fill_team_info()
2739 Team* team = group->teams; in process_group_has_stopped_processes() local
2740 while (team != NULL) { in process_group_has_stopped_processes()
2742 team->LockTeamAndParent(false); in process_group_has_stopped_processes()
2744 if (team->job_control_entry != NULL in process_group_has_stopped_processes()
2745 && team->job_control_entry->state == JOB_CONTROL_STATE_STOPPED) { in process_group_has_stopped_processes()
2746 team->UnlockTeamAndParent(); in process_group_has_stopped_processes()
2750 team->UnlockTeamAndParent(); in process_group_has_stopped_processes()
2752 team = team->group_next; in process_group_has_stopped_processes()
2787 Signal signal(SIGHUP, SI_USER, B_OK, currentThread->team->id); in orphaned_process_group_check()
2805 Team* team = Team::GetAndLock(id); in common_get_team_usage_info() local
2806 if (team == NULL) in common_get_team_usage_info()
2808 BReference<Team> teamReference(team, true); in common_get_team_usage_info()
2809 TeamLocker teamLocker(team, true); in common_get_team_usage_info()
2813 if (uid != 0 && uid != team->effective_uid) in common_get_team_usage_info()
2823 Thread* thread = team->thread_list; in common_get_team_usage_info()
2831 kernelTime += team->dead_threads_kernel_time; in common_get_team_usage_info()
2832 userTime += team->dead_threads_user_time; in common_get_team_usage_info()
2838 Team* child = team->children; in common_get_team_usage_info()
2842 Thread* thread = team->thread_list; in common_get_team_usage_info()
2854 kernelTime += team->dead_children.kernel_time; in common_get_team_usage_info()
2855 userTime += team->dead_children.user_time; in common_get_team_usage_info()
2975 team_get_death_entry(Team* team, thread_id child, bool* _deleteEntry) in team_get_death_entry() argument
2980 job_control_entry* entry = get_job_control_entry(team->dead_children, in team_get_death_entry()
2985 team->dead_children.entries.Remove(entry); in team_get_death_entry()
2986 team->dead_children.count--; in team_get_death_entry()
3020 Team* team = thread_get_current_thread()->team; in team_set_controlling_tty() local
3021 TeamLocker teamLocker(team); in team_set_controlling_tty()
3024 ProcessSession* session = team->group->Session(); in team_set_controlling_tty()
3037 Team* team = thread_get_current_thread()->team; in team_get_controlling_tty() local
3038 TeamLocker teamLocker(team); in team_get_controlling_tty()
3041 ProcessSession* session = team->group->Session(); in team_get_controlling_tty()
3054 Team* team = thread->team; in team_set_foreground_process_group() local
3055 TeamLocker teamLocker(team); in team_set_foreground_process_group()
3058 ProcessSession* session = team->group->Session(); in team_set_foreground_process_group()
3076 && session->foreground_group != team->group_id in team_set_foreground_process_group()
3077 && team->SignalActionFor(SIGTTOU).sa_handler != SIG_IGN in team_set_foreground_process_group()
3079 InterruptsSpinLocker signalLocker(team->signal_lock); in team_set_foreground_process_group()
3081 if (!is_team_signal_blocked(team, SIGTTOU)) { in team_set_foreground_process_group()
3082 pid_t groupID = team->group_id; in team_set_foreground_process_group()
3088 Signal signal(SIGTTOU, SI_USER, B_OK, team->id); in team_set_foreground_process_group()
3104 Team* team = team_get_team_struct_locked(id); in team_geteuid() local
3105 if (team == NULL) in team_geteuid()
3107 return team->effective_uid; in team_geteuid()
3122 team_remove_team(Team* team, pid_t& _signalGroup) in team_remove_team() argument
3124 Team* parent = team->parent; in team_remove_team()
3127 parent->dead_children.kernel_time += team->dead_threads_kernel_time in team_remove_team()
3128 + team->dead_children.kernel_time; in team_remove_team()
3129 parent->dead_children.user_time += team->dead_threads_user_time in team_remove_team()
3130 + team->dead_children.user_time; in team_remove_team()
3134 sTeamHash.Remove(team); in team_remove_team()
3141 team->state = TEAM_STATE_DEATH; in team_remove_team()
3149 if (team->session_id == team->id in team_remove_team()
3150 && team->group->Session()->controlling_tty != NULL) { in team_remove_team()
3153 ProcessSession* session = team->group->Session(); in team_remove_team()
3162 remove_team_from_group(team); in team_remove_team()
3165 while (Team* child = team->children) { in team_remove_team()
3169 remove_team_from_parent(team, child); in team_remove_team()
3174 &team->stopped_children.entries); in team_remove_team()
3176 &team->continued_children.entries); in team_remove_team()
3186 if (childGroup->Session()->id == team->session_id in team_remove_team()
3187 && childGroup->id != team->group_id) { in team_remove_team()
3197 remove_team_from_parent(parent, team); in team_remove_team()
3210 team_shutdown_team(Team* team) in team_shutdown_team() argument
3212 ASSERT(thread_get_current_thread() == team->main_thread); in team_shutdown_team()
3214 TeamLocker teamLocker(team); in team_shutdown_team()
3224 InterruptsSpinLocker debugInfoLocker(team->debug_info.lock); in team_shutdown_team()
3226 if (team->debug_info.debugger_changed_condition != NULL) { in team_shutdown_team()
3227 team->debug_info.debugger_changed_condition->Add( in team_shutdown_team()
3230 } else if (team->debug_info.flags & B_TEAM_DEBUG_DEBUGGER_INSTALLED) { in team_shutdown_team()
3235 debuggerPort = team->debug_info.debugger_port; in team_shutdown_team()
3253 team->state = TEAM_STATE_SHUTDOWN; in team_shutdown_team()
3256 team->DeleteUserTimers(false); in team_shutdown_team()
3259 InterruptsSpinLocker timeLocker(team->time_lock); in team_shutdown_team()
3261 if (team->HasActiveCPUTimeUserTimers()) in team_shutdown_team()
3262 team->DeactivateCPUTimeUserTimers(); in team_shutdown_team()
3268 deathEntry.condition.Init(team, "team death"); in team_shutdown_team()
3271 team->death_entry = &deathEntry; in team_shutdown_team()
3274 Thread* thread = team->thread_list; in team_shutdown_team()
3276 if (thread != team->main_thread) { in team_shutdown_team()
3277 Signal signal(SIGKILLTHR, SI_USER, B_OK, team->id); in team_shutdown_team()
3299 team->death_entry = NULL; in team_shutdown_team()
3310 team_delete_team(Team* team, port_id debuggerPort) in team_delete_team() argument
3317 team_id teamID = team->id; in team_delete_team()
3319 ASSERT(team->num_threads == 0); in team_delete_team()
3325 TeamLocker teamLocker(team); in team_delete_team()
3327 if (team->loading_info != NULL) { in team_delete_team()
3329 team->loading_info->result = B_ERROR; in team_delete_team()
3332 team->loading_info->condition.NotifyAll(); in team_delete_team()
3333 team->loading_info = NULL; in team_delete_team()
3343 &team->watcher_list)) != NULL) { in team_delete_team()
3353 switch (team->exit.reason) { in team_delete_team()
3355 exitStatus = team->exit.status; in team_delete_team()
3358 signal = team->exit.signal; in team_delete_team()
3364 sNotificationService.Notify(TEAM_REMOVED, team); in team_delete_team()
3367 InterruptsSpinLocker timeLocker(team->time_lock); in team_delete_team()
3370 usageInfo.kernel_time = team->dead_threads_kernel_time; in team_delete_team()
3371 usageInfo.user_time = team->dead_threads_user_time; in team_delete_team()
3377 delete_user_mutex_context(team->user_mutex_context); in team_delete_team()
3378 delete_realtime_sem_context(team->realtime_sem_context); in team_delete_team()
3379 xsi_sem_undo(team); in team_delete_team()
3380 remove_images(team); in team_delete_team()
3381 team->address_space->RemoveAndPut(); in team_delete_team()
3383 team->ReleaseReference(); in team_delete_team()
3410 return thread_get_current_thread()->team->id; in team_get_current_team_id()
3426 Team* team = team_get_team_struct_locked(id); in team_get_address_space() local
3427 if (team == NULL) in team_get_address_space()
3430 team->address_space->Get(); in team_get_address_space()
3431 *_addressSpace = team->address_space; in team_get_address_space()
3449 team_set_job_control_state(Team* team, job_control_state newState, in team_set_job_control_state() argument
3452 if (team == NULL || team->job_control_entry == NULL) in team_set_job_control_state()
3457 job_control_entry* entry = team->job_control_entry; in team_set_job_control_state()
3461 T(SetJobControlState(team->id, newState, signal)); in team_set_job_control_state()
3472 team->parent->stopped_children.entries.Remove(entry); in team_set_job_control_state()
3475 team->parent->continued_children.entries.Remove(entry); in team_set_job_control_state()
3493 childList = &team->parent->dead_children; in team_set_job_control_state()
3494 team->parent->dead_children.count++; in team_set_job_control_state()
3497 childList = &team->parent->stopped_children; in team_set_job_control_state()
3500 childList = &team->parent->continued_children; in team_set_job_control_state()
3506 team->parent->dead_children.condition_variable.NotifyAll(); in team_set_job_control_state()
3518 team_init_exit_info_on_error(Team* team) in team_init_exit_info_on_error() argument
3520 TeamLocker teamLocker(team); in team_init_exit_info_on_error()
3522 if (!team->exit.initialized) { in team_init_exit_info_on_error()
3523 team->exit.reason = CLD_KILLED; in team_init_exit_info_on_error()
3524 team->exit.signal = SIGKILL; in team_init_exit_info_on_error()
3525 team->exit.signaling_user = geteuid(); in team_init_exit_info_on_error()
3526 team->exit.status = 0; in team_init_exit_info_on_error()
3527 team->exit.initialized = true; in team_init_exit_info_on_error()
3551 Team* team = Team::GetAndLock(teamID); in start_watching_team() local
3552 if (team == NULL) { in start_watching_team()
3557 list_add_item(&team->watcher_list, watcher); in start_watching_team()
3559 team->UnlockAndReleaseReference(); in start_watching_team()
3572 Team* team = Team::GetAndLock(teamID); in stop_watching_team() local
3573 if (team == NULL) in stop_watching_team()
3579 &team->watcher_list, watcher)) != NULL) { in stop_watching_team()
3582 list_remove_item(&team->watcher_list, watcher); in stop_watching_team()
3587 team->UnlockAndReleaseReference(); in stop_watching_team()
3602 team_allocate_user_thread(Team* team) in team_allocate_user_thread() argument
3604 if (team->user_data == 0) in team_allocate_user_thread()
3608 if (struct free_user_thread* entry = team->free_user_threads) { in team_allocate_user_thread()
3610 team->free_user_threads = entry->next; in team_allocate_user_thread()
3618 if (team->user_data_size - team->used_user_data < needed) { in team_allocate_user_thread()
3620 if (resize_area(team->user_data_area, in team_allocate_user_thread()
3621 team->user_data_size + B_PAGE_SIZE) != B_OK) { in team_allocate_user_thread()
3627 team->user_data_size += B_PAGE_SIZE; in team_allocate_user_thread()
3633 = (user_thread*)(team->user_data + team->used_user_data); in team_allocate_user_thread()
3634 team->used_user_data += needed; in team_allocate_user_thread()
3647 team_free_user_thread(Team* team, struct user_thread* userThread) in team_free_user_thread() argument
3661 TeamLocker teamLocker(team); in team_free_user_thread()
3664 entry->next = team->free_user_threads; in team_free_user_thread()
3665 team->free_user_threads = entry; in team_free_user_thread()
3772 return thread_get_current_thread()->team->AddData(data); in team_associate_data()
3786 return thread_get_current_thread()->team->RemoveData(data); in team_dissociate_data()
3867 Team* team = team_get_team_struct_locked(id); in wait_for_team() local
3868 if (team == NULL) in wait_for_team()
3871 id = team->id; in wait_for_team()
3885 Team* team = team_get_team_struct_locked(id); in kill_team() local
3886 if (team == NULL) in kill_team()
3889 id = team->id; in kill_team()
3893 if (team == sKernelTeam) in kill_team()
3906 Team* team = Team::Get(id); in _get_team_info() local
3907 if (team == NULL) in _get_team_info()
3909 BReference<Team> teamReference(team, true); in _get_team_info()
3912 return fill_team_info(team, info, size); in _get_team_info()
3929 Team* team = NULL; in _get_next_team_info() local
3930 while (slot < lastTeamID && !(team = team_get_team_struct_locked(slot))) in _get_next_team_info()
3933 if (team == NULL) in _get_next_team_info()
3937 BReference<Team> teamReference(team); in _get_next_team_info()
3942 return fill_team_info(team, info, size); in _get_next_team_info()
3959 return thread_get_current_thread()->team->id; in getpid()
3980 Team* team = thread_get_current_thread()->team; in getpgid() local
3981 TeamLocker teamLocker(team); in getpgid()
3982 return team->group_id; in getpgid()
3986 Team* team = Team::GetAndLock(id); in getpgid() local
3987 if (team == NULL) { in getpgid()
3993 pid_t groupID = team->group_id; in getpgid()
3995 team->UnlockAndReleaseReference(); in getpgid()
4011 Team* team = thread_get_current_thread()->team; in getsid() local
4012 TeamLocker teamLocker(team); in getsid()
4013 return team->session_id; in getsid()
4017 Team* team = Team::GetAndLock(id); in getsid() local
4018 if (team == NULL) { in getsid()
4024 pid_t sessionID = team->session_id; in getsid()
4026 team->UnlockAndReleaseReference(); in getsid()
4133 Team* currentTeam = thread_get_current_thread()->team; in _user_setpgid()
4164 Team* team = Team::Get(processID); in _user_setpgid() local
4165 if (team == NULL) in _user_setpgid()
4167 BReference<Team> teamReference(team, true); in _user_setpgid()
4172 team->LockProcessGroup(); in _user_setpgid()
4174 ProcessGroup* oldGroup = team->group; in _user_setpgid()
4177 ASSERT(team->state >= TEAM_STATE_SHUTDOWN); in _user_setpgid()
4207 TeamLocker teamLocker(team); in _user_setpgid()
4208 if (team->group == oldGroup) in _user_setpgid()
4219 BReference<ProcessGroup> oldGroupReference(team->group, true); in _user_setpgid()
4220 AutoLocker<ProcessGroup> oldGroupLocker(team->group, true); in _user_setpgid()
4224 team->LockTeamAndParent(false); in _user_setpgid()
4225 TeamLocker parentLocker(team->parent, true); in _user_setpgid()
4226 TeamLocker teamLocker(team, true); in _user_setpgid()
4229 if (team == currentTeam) { in _user_setpgid()
4239 if (team->parent != currentTeam in _user_setpgid()
4240 || team->session_id != currentTeam->session_id) { in _user_setpgid()
4246 if ((team->flags & TEAM_FLAG_EXEC_DONE) != 0) in _user_setpgid()
4259 group->PublishLocked(team->group->Session()); in _user_setpgid()
4260 } else if (group->Session()->id != team->session_id) { in _user_setpgid()
4267 remove_team_from_group(team); in _user_setpgid()
4268 insert_team_into_group(group, team); in _user_setpgid()
4272 team->parent->dead_children.condition_variable.NotifyAll(); in _user_setpgid()
4282 Team* team = thread_get_current_thread()->team; in _user_setsid() local
4285 ProcessGroup* group = new(std::nothrow) ProcessGroup(team->id); in _user_setsid()
4297 team->LockTeamParentAndProcessGroup(); in _user_setsid()
4298 BReference<ProcessGroup> oldGroupReference(team->group); in _user_setsid()
4299 AutoLocker<ProcessGroup> oldGroupLocker(team->group, true); in _user_setsid()
4300 TeamLocker parentLocker(team->parent, true); in _user_setsid()
4301 TeamLocker teamLocker(team, true); in _user_setsid()
4304 if (is_process_group_leader(team)) in _user_setsid()
4308 remove_team_from_group(team); in _user_setsid()
4310 insert_team_into_group(group, team); in _user_setsid()
4314 team->parent->dead_children.condition_variable.NotifyAll(); in _user_setsid()
4373 Team* team = thread->team; in _user_exit_team() local
4379 TeamLocker teamLocker(team); in _user_exit_team()
4381 if (!team->exit.initialized) { in _user_exit_team()
4382 team->exit.reason = CLD_EXITED; in _user_exit_team()
4383 team->exit.signal = 0; in _user_exit_team()
4384 team->exit.signaling_user = 0; in _user_exit_team()
4385 team->exit.status = returnValue; in _user_exit_team()
4386 team->exit.initialized = true; in _user_exit_team()
4398 if ((atomic_get(&team->debug_info.flags) & B_TEAM_DEBUG_PREVENT_EXIT) != 0) in _user_exit_team()
4405 Signal signal(SIGKILL, SI_USER, B_OK, team->id); in _user_exit_team()
4411 _user_kill_team(team_id team) in _user_kill_team() argument
4413 return kill_team(team); in _user_kill_team()
4474 _user_get_team_usage_info(team_id team, int32 who, team_usage_info* userInfo, in _user_get_team_usage_info() argument
4481 status_t status = common_get_team_usage_info(team, who, &info, in _user_get_team_usage_info()
4522 Team* team = Team::GetAndLock(teamID); in _user_get_extended_team_info() local
4523 if (team == NULL) in _user_get_extended_team_info()
4525 BReference<Team> teamReference(team, true); in _user_get_extended_team_info()
4526 TeamLocker teamLocker(team, true); in _user_get_extended_team_info()
4529 teamClone.id = team->id; in _user_get_extended_team_info()
4530 strlcpy(teamClone.name, team->Name(), sizeof(teamClone.name)); in _user_get_extended_team_info()
4531 teamClone.group_id = team->group_id; in _user_get_extended_team_info()
4532 teamClone.session_id = team->session_id; in _user_get_extended_team_info()
4533 teamClone.real_uid = team->real_uid; in _user_get_extended_team_info()
4534 teamClone.real_gid = team->real_gid; in _user_get_extended_team_info()
4535 teamClone.effective_uid = team->effective_uid; in _user_get_extended_team_info()
4536 teamClone.effective_gid = team->effective_gid; in _user_get_extended_team_info()
4539 ioContext = team->io_context; in _user_get_extended_team_info()