1
0
mirror of https://github.com/bspeice/qadapt synced 2025-07-03 06:45:02 -04:00

Add some more tests

This commit is contained in:
2018-11-06 20:51:44 -05:00
parent 03310c6372
commit 16a0238dc5
2 changed files with 68 additions and 1 deletions

View File

@ -20,7 +20,15 @@ static LOG_LEVEL: RwLock<Level> = RwLock::new(Level::Debug);
pub struct QADAPT;
pub fn set_panic(b: bool) {
*DO_PANIC.write() = b;
let mut val = DO_PANIC.write();
if *val == b {
let level = LOG_LEVEL.read();
if log_enabled!(*level) {
log!(*level, "Panic flag was already {}, potential data race", b)
}
}
*val = b;
}
pub fn set_log_level(level: Level) {