ax-net 0.13.3

Unified network stack for TGOSKits (ArceOS, StarryOS, Axvisor)
Documentation
//! Fixed-owner notification for one network queue executor.

use ax_task::sync::irq::{IrqWaitCell, IrqWorkerWaiter};

/// Sticky hard-IRQ event consumed by one CPU-pinned queue executor.
pub(super) struct QueueNotification {
    event: IrqWaitCell,
}

impl QueueNotification {
    pub(super) const fn new() -> Self {
        Self {
            event: IrqWaitCell::new(),
        }
    }

    pub(super) fn notify(&self) {
        let _result = self.event.notify();
    }

    pub(super) fn wait(&self, waiter: &IrqWorkerWaiter) {
        waiter
            .wait(&self.event)
            .unwrap_or_else(|error| panic!("network queue executor notification failed: {error}"));
    }

    pub(super) fn wait_timeout(&self, waiter: &IrqWorkerWaiter, timeout: core::time::Duration) {
        let _timed_out = waiter
            .wait_timeout(&self.event, timeout)
            .unwrap_or_else(|error| panic!("network queue executor notification failed: {error}"));
    }
}