Files
RedBear-OS/src/header/pthread/once.rs
T
2023-05-17 15:28:10 +02:00

21 lines
417 B
Rust

use super::*;
// PTHREAD_ONCE_INIT
#[no_mangle]
pub unsafe extern "C" fn pthread_once(
once: *mut pthread_once_t,
constructor: extern "C" fn(),
) -> c_int {
let once = &*once.cast::<RlctOnce>();
// TODO: Cancellation points
once.call_once(|| constructor());
//crate::sync::once::call_once_generic(&once.inner, || constructor());
0
}
pub(crate) type RlctOnce = crate::sync::Once<()>;