Right now the behaviour of assert!
is to stop/terminate current thread (where it was called).
For example, this code running in a non-main thread:
impl Reader {
pub fn event_loop(&self) {
while self.stop_requested.load(std::sync::atomic::Ordering::Relaxed) == false {
assert!(false);
produces this output:
thread '<unnamed>' panicked at digester/src/source/file.rs:109:10:
assertion failed: false
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Printing a message every second...
Printing a message every second...
as you can see, another process continues working.
Adding this in Cargo.toml
does not work:
[profile.dev]
panic = "abort"
[profile.release]
panic = "abort"
P.S.
I understand that I can manually inspect what thread.join returns (for example, reader_thread.join().unwrap();
), but this is not what I am asking.