mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
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>
This commit is contained in:
committed by
GitHub
parent
ad8c543fb5
commit
688e6128d4
@@ -9,7 +9,7 @@ extern "C" {
|
||||
|
||||
#[cfg(feature = "custom_allocator")]
|
||||
mod allocator {
|
||||
use std::alloc::{GlobalAlloc, Layout};
|
||||
use core::alloc::{GlobalAlloc, Layout};
|
||||
|
||||
struct RegorusAllocator {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user