pub struct TaskBuilder {
pub task: OwnedRef<Task>,
pub thread_state: Box<ThreadState>,
}Fields§
§task: OwnedRef<Task>The underlying task object.
thread_state: Box<ThreadState>Implementations§
Source§impl TaskBuilder
impl TaskBuilder
pub fn new(task: OwnedRef<Task>) -> Self
pub fn release<L>(self, locked: &mut Locked<L>)where
L: LockBefore<TaskRelease>,
Methods from Deref<Target = Task>§
pub fn kernel(&self) -> &Arc<Kernel>
pub fn thread_group(&self) -> &Arc<ThreadGroup>
pub fn has_same_address_space(&self, other: Option<&Arc<MemoryManager>>) -> bool
pub fn flags(&self) -> TaskFlags
Sourcepub fn set_ptrace_zombie(&self, pids: &mut PidTable)
pub fn set_ptrace_zombie(&self, pids: &mut PidTable)
When the task exits, if there is a notification that needs to propagate to a ptracer, make sure it will propagate.
pub fn exit_status(&self) -> Option<ExitStatus>
pub fn is_exitted(&self) -> bool
pub fn load_stopped(&self) -> StopState
pub fn read<'a>(self: &'a Task) -> TaskReadGuard<'a>
pub fn write<'a>(self: &'a Task) -> TaskWriteGuard<'a>
pub fn add_file<L>(
&self,
locked: &mut Locked<L>,
file: FileHandle,
flags: FdFlags,
) -> Result<FdNumber, Errno>where
L: LockEqualOrBefore<FileOpsCore>,
Sourcepub fn real_creds(&self) -> Credentials
pub fn real_creds(&self) -> Credentials
Returns the real credentials of the task. These credentials are used to check permissions
for actions performed on the task. If the task itself is performing an action, use
CurrentTask::current_creds instead.
pub fn with_real_creds<B, F>(&self, f: F) -> Bwhere
F: FnOnce(&Credentials) -> B,
pub fn ptracer_task(&self) -> WeakRef<Task>
pub fn fs(&self) -> Arc<FsContext>
pub fn mm(&self) -> Result<Arc<MemoryManager>, Errno>
Sourcepub fn set_scheduler_state(
&self,
scheduler_state: SchedulerState,
) -> Result<(), Errno>
pub fn set_scheduler_state( &self, scheduler_state: SchedulerState, ) -> Result<(), Errno>
Overwrite the existing scheduler state with a new one and update the task’s thread’s role.
Sourcepub fn sync_scheduler_state_to_role(&self) -> Result<(), Errno>
pub fn sync_scheduler_state_to_role(&self) -> Result<(), Errno>
Update the task’s thread’s role based on its current scheduler state without making any changes to the state.
This should be called on tasks that have newly created threads, e.g. after cloning.
Sourcepub fn signal_vfork(&self)
pub fn signal_vfork(&self)
Signals the vfork event, if any, to unblock waiters.
Sourcepub fn wait_for_execve(&self, task_to_wait: WeakRef<Task>) -> Result<(), Errno>
pub fn wait_for_execve(&self, task_to_wait: WeakRef<Task>) -> Result<(), Errno>
Blocks the caller until the task has exited or executed execve(). This is used to implement vfork() and clone(… CLONE_VFORK, …). The task must have created with CLONE_EXECVE.
Sourcepub fn clear_child_tid_if_needed<L>(
&self,
locked: &mut Locked<L>,
) -> Result<(), Errno>where
L: LockBefore<TerminalLock>,
pub fn clear_child_tid_if_needed<L>(
&self,
locked: &mut Locked<L>,
) -> Result<(), Errno>where
L: LockBefore<TerminalLock>,
If needed, clear the child tid for this task.
Userspace can ask us to clear the child tid and issue a futex wake at the child tid address when we tear down a task. For example, bionic uses this mechanism to implement pthread_join. The thread that calls pthread_join sleeps using FUTEX_WAIT on the child tid address. We wake them up here to let them know the thread is done.
pub fn get_task(&self, tid: tid_t) -> WeakRef<Task>
pub fn get_pid(&self) -> pid_t
pub fn get_tid(&self) -> tid_t
pub fn is_leader(&self) -> bool
pub fn read_argv(&self, max_len: usize) -> Result<Vec<FsString>, Errno>
pub fn read_argv0(&self) -> Result<FsString, Errno>
pub fn read_env(&self, max_len: usize) -> Result<Vec<FsString>, Errno>
pub fn thread_runtime_info(&self) -> Result<TaskRuntimeInfo, Errno>
pub fn real_fscred(&self) -> FsCred
Sourcepub fn interrupt(&self)
pub fn interrupt(&self)
Interrupts the current task.
This will interrupt any blocking syscalls if the task is blocked on one. The signal_state of the task must not be locked.
pub fn command(&self) -> TaskCommand
pub fn set_command_name(&self, new_name: TaskCommand)
pub fn set_seccomp_state(&self, state: SeccompStateValue) -> Result<(), Errno>
pub fn state_code(&self) -> TaskStateCode
pub fn time_stats(&self) -> TaskTimeStats
pub fn get_signal_action(&self, signal: Signal) -> sigaction_t
pub fn record_pid_koid_mapping(&self)
Trait Implementations§
Source§impl Deref for TaskBuilder
impl Deref for TaskBuilder
Source§impl From<TaskBuilder> for AutoReleasableTask
impl From<TaskBuilder> for AutoReleasableTask
Source§fn from(builder: TaskBuilder) -> Self
fn from(builder: TaskBuilder) -> Self
Source§impl From<TaskBuilder> for CurrentTask
impl From<TaskBuilder> for CurrentTask
Source§fn from(builder: TaskBuilder) -> Self
fn from(builder: TaskBuilder) -> Self
Source§impl Releasable for TaskBuilder
impl Releasable for TaskBuilder
Auto Trait Implementations§
impl Freeze for TaskBuilder
impl !RefUnwindSafe for TaskBuilder
impl Send for TaskBuilder
impl Sync for TaskBuilder
impl Unpin for TaskBuilder
impl !UnwindSafe for TaskBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [Self]Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more