Skip to main content

run_with_gil

Function run_with_gil 

Source
pub fn run_with_gil<R, F>(f: F) -> R
where F: FnOnce() -> R,
Available on crate feature object only.
Expand description

Run the given function while holding the GIL.

This is sometimes used to avoid the overhead of repeatedly releasing and acquiring the GIL.