starry-kernel 0.8.3

A Linux-compatible OS kernel built on ArceOS unikernel
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use alloc::sync::Arc;

use ax_cgroup::{CgroupNamespace, CgroupNode};

use crate::sync::IrqMutex;

/// The initial cgroup namespace rooted at the global cgroup hierarchy.
pub static ROOT_CGROUP_NS: ax_lazyinit::LazyLock<Arc<IrqMutex<CgroupNamespace>>> =
    ax_lazyinit::LazyLock::new(|| Arc::new(IrqMutex::new(CgroupNamespace::new(ax_cgroup::root()))));

/// Create a new cgroup namespace rooted at the supplied membership.
pub fn new_cgroup_namespace(root: Arc<CgroupNode>) -> Arc<IrqMutex<CgroupNamespace>> {
    Arc::new(IrqMutex::new(CgroupNamespace::new(root)))
}