Function sdd::suspend

source ·
pub fn suspend() -> bool
Expand description

Suspends the garbage collector of the current thread.

If returns false if there is an active Guard in the thread. Otherwise, it passes all its retired instances to a free flowing garbage container that can be cleaned up by other threads.

§Examples

use sdd::{suspend, Guard};

assert!(suspend());

{
    let guard = Guard::new();
    assert!(!suspend());
}

assert!(suspend());