Skip to content

The callback that will be called if the current thread panics

Notifications You must be signed in to change notification settings

bells307/drop-panic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

drop-panic

The callback that will be called if the current thread panics.

Example

let panicked = Arc::new(AtomicBool::new(false));

let jh = thread::spawn({
    let panicked = Arc::clone(&panicked);
    move || {
        drop_panic! {
            panicked.store(true, Ordering::Release);
        };

        panic!("boom");
    }
});

assert!(jh.join().is_err());
assert!(panicked.load(Ordering::Acquire));

About

The callback that will be called if the current thread panics

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages