Skip to main content

set_thread_id_hook

Function set_thread_id_hook 

Source
pub fn set_thread_id_hook(
    _hook: impl Fn() -> usize + Send + Sync + 'static,
) -> Result<()>
Available on crate feature std or non-crate feature threads only.
Expand description

Install the hook that tells the library which execution context is running.

Only meaningful in a no_std build with the threads feature; with the standard library a thread-local is used instead and this is a no-op that reports success. Can only be set once.