Lines Matching full:current

32 macro_rules! current {  macro
36 unsafe { &*$crate::task::Task::current() }
61 /// The following is an example of getting the PID of the current thread with zero additional cost
65 /// let pid = current!().pid();
68 /// Getting the PID of the current process, also zero additional cost:
71 /// let pid = current!().group_leader().pid();
74 /// Getting the current task and storing it in some struct. The reference count is automatically
88 /// creator: current!().into(),
97 // SAFETY: By design, the only way to access a `Task` is via the `current` function or via an
118 /// Returns a raw pointer to the current task.
123 // SAFETY: Getting the current pointer is always safe. in current_raw()
129 /// The recommended way to get the current task/thread is to use the
130 /// [`current`] macro because it is safe.
134 /// Callers must ensure that the returned object doesn't outlive the current task/thread.
135 pub unsafe fn current() -> impl Deref<Target = Task> { in current() method
149 let current = Task::current_raw(); in current() localVariable
151 // SAFETY: If the current thread is still running, the current task is valid. Given in current()
154 task: unsafe { &*current.cast() }, in current()
163 /// current task's/thread's pid namespace is to use the [`current_pid_ns`] macro because it is
168 /// Callers must ensure that the returned object doesn't outlive the current task/thread.
200 // (1) retrieving the `PidNamespace` of the `current` task in current_pid_ns()
201 // (2) retrieving the `PidNamespace` of a non-`current` task in current_pid_ns()
205 // `PidNamespace` after `release_task()` for current will return `NULL` but no codepath in current_pid_ns()
210 // must've been acquired while holding the RCU lock. Note that accessing a non-`current` in current_pid_ns()
211 // task means `NULL` can be returned as the non-`current` task could have already passed in current_pid_ns()
218 // Rust to handle the common case of accessing `current`'s `PidNamespace` without RCU in current_pid_ns()
237 // SAFETY: The current task's pid namespace is valid as long as the current task is running. in current_pid_ns()
240 // SAFETY: If the current thread is still running, the current task and its associated in current_pid_ns()
242 // transferred to another thread (where it could potentially outlive the current in current_pid_ns()
244 // current task/thread. in current_pid_ns()
343 /// Get the current euid.
364 /// Uses the namespace of the current task.