Lines Matching +full:- +full:- +full:valid +full:- +full:-

1 // SPDX-License-Identifier: GPL-2.0
14 // SAFETY: Deref + addr-of below create a temporary `TaskRef` that cannot outlive the
24 /// All instances are valid tasks created by the C portion of the kernel.
26 /// Instances of this type are always ref-counted, that is, a call to `get_task_struct` ensures
27 /// that the allocation remains valid at least until the matching call to `put_task_struct`.
56 /// fn new() -> Self {
90 pub unsafe fn current() -> impl Deref<Target = Task> { in current()
99 fn deref(&self) -> &Self::Target { in current()
108 // SAFETY: If the current thread is still running, the current task is valid. Given in current()
117 pub fn group_leader(&self) -> &Task { in group_leader()
118 // SAFETY: By the type invariant, we know that `self.0` is a valid task. Valid tasks always in group_leader()
119 // have a valid group_leader. in group_leader()
123 // and given that a task has a reference to its group leader, we know it must be valid for in group_leader()
129 pub fn pid(&self) -> Pid { in pid()
130 // SAFETY: By the type invariant, we know that `self.0` is a valid task. Valid tasks always in pid()
131 // have a valid pid. in pid()
136 pub fn signal_pending(&self) -> bool { in signal_pending()
137 // SAFETY: By the type invariant, we know that `self.0` is valid. in signal_pending()
143 // SAFETY: By the type invariant, we know that `self.0.get()` is non-null and valid. in wake_up()
144 // And `wake_up_process` is safe to be called for any valid task, even if the task is in wake_up()
150 // SAFETY: The type invariants guarantee that `Task` is always ref-counted.