Skip to main content

with_current_info

Function with_current_info 

Source
pub fn with_current_info<R>(f: impl FnOnce(Option<&ThreadInfo>) -> R) -> R
Available on (FreeBSD or GNU/Hurd or illumos or Linux or macOS or NetBSD or OpenBSD or Solaris) and non-miri only.
Expand description

Get the current thread’s information, if available.

Calling this function might freeze other threads if they attempt to modify their thread information. Thus, the caller should ensure that the process is aborted shortly after this function is called.

This function is guaranteed to be async-signal-safe if f is too.