executor: Inline enqueue fns
This commit is contained in:
parent
39e5677621
commit
d32477f5a1
2 changed files with 2 additions and 0 deletions
|
@ -257,6 +257,7 @@ impl Executor {
|
|||
/// - `task` must be a valid pointer to a spawned task.
|
||||
/// - `task` must be set up to run in this executor.
|
||||
/// - `task` must NOT be already enqueued (in this executor or another one).
|
||||
#[inline(always)]
|
||||
unsafe fn enqueue(&self, cs: CriticalSection, task: *mut TaskHeader) {
|
||||
if self.run_queue.enqueue(cs, task) {
|
||||
(self.signal_fn)(self.signal_ctx)
|
||||
|
|
|
@ -44,6 +44,7 @@ impl RunQueue {
|
|||
/// # Safety
|
||||
///
|
||||
/// `item` must NOT be already enqueued in any queue.
|
||||
#[inline(always)]
|
||||
pub(crate) unsafe fn enqueue(&self, _cs: CriticalSection, task: *mut TaskHeader) -> bool {
|
||||
let prev = self.head.load(Ordering::Relaxed);
|
||||
(*task).run_queue_item.next.store(prev, Ordering::Relaxed);
|
||||
|
|
Loading…
Reference in a new issue