Files
regorus/bindings/ffi/src/lib.rs
Anand Krishnamoorthi 688e6128d4 feat: Detect incorrect multi-threaded use from c based ffi (#499)
Add runtime detection for shared handle misuse

wrap the FFI engine handle with parking_lot::RwLock when the new
contention_checks feature is enabled, surfacing a clear “handle is already
in use” error instead of allowing undefined behavior
keep the feature optional so no_std builds or environments that supply
their own synchronization can opt out
caution users that this guards the handle itself but does not make the
engine’s operations globally thread-safe on its own

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
2025-11-17 14:21:13 -06:00

17 lines
287 B
Rust

// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
#![cfg_attr(not(feature = "std"), no_std)]
extern crate alloc;
mod allocator;
mod common;
mod compile;
mod compiled_policy;
mod effect_registry;
mod engine;
mod lock;
mod schema_registry;
mod target_registry;