pub type ThreadParam = Arc<dyn Any + Send + Sync>;Expand description
All OSAL trait definitions for advanced usage. Type-erased parameter that can be passed to thread callbacks.
Allows passing arbitrary data to thread functions in a thread-safe manner.
The parameter is wrapped in an Arc for safe sharing across thread boundaries
and can be downcast to its original type using downcast_ref().
§Thread Safety
The inner type must implement Any + Send + Sync to ensure it can be
safely shared between threads.
§Examples
use osal_rs::os::*;
use std::sync::Arc;
// Create a parameter
let param: ThreadParam = Arc::new(42u32);
// In the thread callback, downcast to access it
assert_eq!(param.downcast_ref::<u32>(), Some(&42));
// A downcast to the wrong type simply reports `None`.
assert!(param.downcast_ref::<i8>().is_none());Aliased Type§
pub struct ThreadParam { /* private fields */ }