executor: Inline enqueue fns

This commit is contained in:
Dario Nieuwenhuis 2021-10-16 01:49:30 +02:00
parent 39e5677621
commit d32477f5a1
2 changed files with 2 additions and 0 deletions

View file

@ -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)

View file

@ -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);