Lines Matching refs:team

45 #include <team.h>
132 event.AddInt32("team", teamID);
142 return Notify(eventCode, thread->id, thread->team->id, thread);
189 team(NULL),
434 if (timer->ID() < 0 && !team->CheckAddUserDefinedTimer())
456 team->UserDefinedTimersRemoved(1);
472 team->UserDefinedTimersRemoved(count);
506 // get the next team -- if there is one, get reference for it
520 const char* name, int32 priority, void* arg, team_id team,
533 this->team = team >= 0 ? team : team_get_kernel_team()->id;
579 team = currentThread->team->id;
595 /*! Inserts a thread into a team.
596 The caller must hold the team's lock, the thread's lock, and the scheduler
600 insert_thread_into_team(Team *team, Thread *thread)
602 thread->team_next = team->thread_list;
603 team->thread_list = thread;
604 team->num_threads++;
606 if (team->num_threads == 1) {
608 team->main_thread = thread;
610 thread->team = team;
614 /*! Removes a thread from a team.
615 The caller must hold the team's lock, the thread's lock, and the scheduler
619 remove_thread_from_team(Team *team, Thread *thread)
623 for (temp = team->thread_list; temp != NULL; temp = temp->team_next) {
626 team->thread_list = temp->team_next;
630 team->num_threads--;
740 // If that's the team's main thread, init the team exit info.
741 if (thread == thread->team->main_thread)
742 team_init_exit_info_on_error(thread->team);
797 create_thread_user_stack(Team* team, Thread* thread, void* _stackBase,
821 stackSize = thread->id == team->id
845 stackArea = create_area_etc(team->id, nameBuffer,
868 thread_create_user_stack(Team* team, Thread* thread, void* stackBase,
872 return create_thread_user_stack(team, thread, stackBase, stackSize,
879 \param attributes The thread creation attributes, specifying the team in
894 // get the team
895 Team* team = Team::Get(attributes.team);
896 if (team == NULL)
898 BReference<Team> teamReference(team, true);
912 thread->team = team;
913 // set already, so, if something goes wrong, the team pointer is
944 // we're not yet part of a team, so we can just bail out
968 status = create_thread_user_stack(team, thread,
992 status = user_timer_create_thread_timers(team, thread);
997 // lock the team and see, if it is still alive
998 TeamLocker teamLocker(team);
999 if (team->state >= TEAM_STATE_SHUTDOWN)
1006 thread->user_thread = team_allocate_user_thread(team);
1011 // If the new thread belongs to the same team as the current thread, it
1014 if (currentThread != NULL && currentThread->team == team) {
1055 team_free_user_thread(team, userThread);
1069 // or the respective global team debug flag is set. But only, if a
1070 // debugger is installed for the team.
1072 int32 teamDebugFlags = atomic_get(&team->debug_info.flags);
1081 SpinLocker signalLocker(team->signal_lock);
1082 SpinLocker timeLocker(team->time_lock);
1084 // insert thread into team
1085 insert_thread_into_team(team, thread);
1131 // remove this thread from from the kernel team -- this makes it
1185 info->team = thread->team->id;
1674 kprintf("%-*s id state wait for %-*s cpu pri %-*s team "
1757 (void *)thread->kernel_stack_base, thread->team->id, thread->name);
1841 kprintf("team: %p, \"%s\"\n", thread->team,
1842 thread->team->Name());
1924 team_id team = -1;
1953 team = strtoul(argv[1], NULL, 0);
1954 if (team == 0)
1955 kprintf("ignoring invalid team argument.\n");
1967 || (team > 0 && thread->team->id != team)
1995 Team* team = thread->team;
1999 team_id teamID = team->id;
2010 if (team != kernelTeam) {
2022 // is, we can save the work, since it will be deleted with the team's
2024 if (thread != team->main_thread)
2025 team_free_user_thread(team, userThread);
2030 if (team->address_space != NULL && thread->user_stack_area >= 0) {
2040 if (team != kernelTeam) {
2043 if (team->main_thread == thread) {
2044 // The main thread is exiting. Shut down the whole team.
2048 debuggerPort = team_shutdown_team(team);
2051 // team lock, parent team lock, and the team lock
2052 team->LockProcessGroup();
2054 team->LockTeamAndParent(true);
2059 // acquire necessary locks, which are: kernel team lock and the team
2062 team->Lock();
2070 vm_swap_address_space(team->address_space, VMAddressSpace::Kernel());
2075 // team needs to be an atomic operation
2087 team->dead_threads_kernel_time += thread->kernel_time;
2088 team->dead_threads_user_time += thread->user_time;
2090 // stop/update thread/team CPU time user timers
2092 || team->HasActiveCPUTimeUserTimers()) {
2102 // put the thread into the kernel team until it dies
2103 remove_thread_from_team(team, thread);
2111 if (team->death_entry != NULL) {
2112 if (--team->death_entry->remaining_threads == 0)
2113 team->death_entry->condition.NotifyOne();
2117 Team* parent = team->parent;
2119 // Set the team job control state to "dead" and detach the job
2120 // control entry from our team struct.
2121 team_set_job_control_state(team, JOB_CONTROL_STATE_DEAD, NULL);
2122 death = team->job_control_entry;
2123 team->job_control_entry = NULL;
2143 // Get a temporary reference to the team's process group
2144 // -- team_remove_team() removes the team from the group, which
2146 ProcessGroup* group = team->group;
2150 team_remove_team(team, foregroundGroupToSignal);
2152 // unlock everything but the parent team
2153 team->Unlock();
2161 Signal childSignal(SIGCHLD, team->exit.reason, B_OK, team->id);
2162 if (team->exit.reason == CLD_EXITED) {
2163 childSignal.SetStatus(team->exit.status);
2165 childSignal.SetStatus(team->exit.signal);
2166 childSignal.SetSendingUser(team->exit.signaling_user);
2173 // If the team was a session leader with controlling TTY, we have
2176 Signal groupSignal(SIGHUP, SI_USER, B_OK, team->id);
2189 list_add_item(&team->dead_threads, threadDeathEntry);
2196 team->Unlock();
2204 // delete the team if we're its main thread
2206 team_delete_team(team, debuggerPort);
2302 // When the team is deleted, all areas are deleted anyway, so we don't
2495 void *arg, team_id team)
2498 ThreadCreationAttributes(function, name, priority, arg, team),
2530 // find its death entry in our team
2531 Team* team = thread_get_current_thread()->team;
2532 TeamLocker teamLocker(team);
2538 = team_get_death_entry(team, id, &deleteEntry);
2544 // check the thread death entries of the team (non-main threads)
2547 &team->dead_threads, threadDeathEntry)) != NULL) {
2549 list_remove_item(&team->dead_threads, threadDeathEntry);
2560 // we found the thread's death entry in our team
2752 thread->team = team_get_kernel_team();
2765 insert_thread_into_team(thread->team, thread);
2788 "[ <team> ]\n"
2789 "Prints a list of all existing threads, or, if a team ID is given,\n"
2790 "all threads of the specified team.\n"
2791 " <team> - The ID of the team whose threads shall be listed.\n", 0);
3054 if (thread->team->id == team_get_kernel_team_id())
3057 if (thread->team == currentThread->team
3058 || currentThread->team->effective_uid == 0
3059 || thread->team->real_uid == currentThread->team->real_uid)
3083 Signal signal(number, signalCode, errorCode, currentThread->team->id);
3095 Team* team = thread->team;
3102 if (team != team_get_kernel_team()) {
3103 // If this is its main thread, set the team's exit status.
3104 if (thread == team->main_thread) {
3105 TeamLocker teamLocker(team);
3107 if (!team->exit.initialized) {
3108 team->exit.reason = CLD_EXITED;
3109 team->exit.signal = 0;
3110 team->exit.signaling_user = 0;
3111 team->exit.status = returnValue;
3112 team->exit.initialized = true;
3118 Signal signal(SIGKILLTHR, SI_USER, B_OK, team->id);
3169 if (!kernel && thread->team != currentThread->team)
3218 // get the team
3219 Team* team = Team::GetAndLock(teamID);
3220 if (team == NULL)
3222 BReference<Team> teamReference(team, true);
3223 TeamLocker teamLocker(team, true);
3229 thread = team->main_thread;
3234 // kernel team, to which threads are added when they are dying.
3235 for (Thread* next = team->thread_list; next != NULL;
3298 if (thread->team != thread_get_current_thread()->team)
3303 team_id teamID = thread->team->id;
3477 // only threads of the same team can be canceled
3478 if (thread->team != thread_get_current_thread()->team)
3486 SpinLocker locker(thread->team->signal_lock);
3658 _user_get_next_thread_info(team_id team, int32 *userCookie,
3669 status = _get_next_thread_info(team, &cookie, &info, sizeof(thread_info));