trait MemBarrierImpl {
fn is_supported() -> bool;
fn register();
fn perform();
}
cfg_select! {
target_os = "linux" => {
mod linux;
type MemBarrierChosenImpl = linux::MemBarrierImplLinux;
}
target_os = "windows" => {
mod windows;
type MemBarrierChosenImpl = windows::MemBarrierImplWindows;
}
_ => {
compile_error!(
"unsupported operating system: the membarrier operation is currently not supported on this operating system"
);
}
}
pub fn is_supported() -> bool {
MemBarrierChosenImpl::is_supported()
}
pub fn register() {
MemBarrierChosenImpl::register();
}
pub fn perform() {
MemBarrierChosenImpl::perform();
}