Lines Matching refs:coalition

33 #include <kern/coalition.h>
75 struct coalition {
84 * Count the length of time this coalition had at least one active task.
90 uint64_t task_count; /* Count of tasks that have started in this coalition */
91 uint64_t dead_task_count; /* Count of tasks that have exited in this coalition; subtract from task_count to get count of "active" */
92 queue_head_t tasks; /* List of active tasks in the coalition */
99 uint32_t active_count; /* Number of members of (tasks in) the coalition, plus vouchers referring to the coalition */
101 unsigned int privileged : 1; /* Members of this coalition may create and manage coalitions and may posix_spawn processes into selected coalitions */
107 /* state of the coalition */
108 unsigned int termrequested : 1; /* launchd has requested termination when coalition becomes empty */
109 unsigned int terminated : 1; /* coalition became empty and spawns are now forbidden */
168 * Start with the coalition's ledger, which holds the totals from all
178 * out from under us, since we hold the coalition lock.
188 /* collect information from the coalition itself */
236 * Returns: New coalition object, referenced for the caller and unlocked.
242 struct coalition *new_coal = (struct coalition *)zalloc(coalition_zone);
278 * Condition: coalition must be UNLOCKED.
343 panic("resurrecting coalition %p id %llu, active_count = %u\n",
364 * This is the function to use when putting a 'new' thing into a coalition,
386 /* Too late to put something new into this coalition, it's
394 panic("resurrecting coalition %p id %llu, active_count = %u\n",
425 return task->coalition->id;
437 return task->coalition->privileged || unrestrict_coalition_syscalls;
443 * Condition: Caller must have a coalition reference.
453 * coalition, and want to extend it to a second activation owned by a new
454 * object, like when a task in the coalition calls fork(). This is analogous
464 panic("cannot make a reaped coalition active again");
522 panic("failed to adopt task %p into default coalition: %d", task, kr);
529 * Condition: Coalition must be referenced and unlocked. Will fail if coalition
535 if (task->coalition) {
549 task->coalition = coal;
555 panic("%s: coalition %p id %llu task_count < dead_task_count", __func__, coal, coal->id);
579 * Condition: task must be referenced and UNLOCKED; task's coalition must be UNLOCKED
584 coalition_t coal = task->coalition;
593 panic("%s: coalition %p id %llu task_count < dead_task_count", __func__, coal, coal->id);
718 sizeof(struct coalition),
719 CONFIG_COALITION_MAX * sizeof(struct coalition),
720 COALITION_CHUNK * sizeof(struct coalition),
731 lck_grp_init(&coalitions_lck_grp, "coalition", &coalitions_lck_grp_attr);
739 panic("%s: could not create default coalition: %d", __func__, kr);