use super::*;
#[test]
fn a_waiter_serving_the_queue_is_served_while_the_holder_barges() {
crate::sync::loom_model::a_waiter_serving_the_queue_is_served_while_the_holder_barges();
}
#[test]
#[should_panic(expected = "the drain ran")]
fn calibration_a_marker_lowered_on_a_pending_nudge_keeps_the_drain_passing() {
crate::sync::loom_model::calibration_a_marker_lowered_on_a_pending_nudge_keeps_the_drain_passing();
}
#[test]
fn the_first_attempt_refuses_a_lock_owed_to_a_waiter() {
crate::sync::loom_model::the_first_attempt_refuses_a_lock_owed_to_a_waiter();
}
#[test]
#[should_panic(expected = "the holder took a lock owed to the queued waiter")]
fn calibration_a_first_attempt_that_ignores_handoff_barges_past_an_owed_waiter() {
crate::sync::loom_model::calibration_a_first_attempt_that_ignores_handoff_barges_past_an_owed_waiter();
}
#[test]
fn a_nudge_while_the_waiter_spins_is_never_lost() {
crate::sync::loom_model::a_nudge_while_the_waiter_spins_is_never_lost();
}
#[test]
#[should_panic(expected = "the waiter armed and slept beside an unread mark")]
fn calibration_a_node_spin_that_skips_its_look_sleeps_beside_the_mark() {
crate::sync::loom_model::calibration_a_node_spin_that_skips_its_look_sleeps_beside_the_mark();
}
#[test]
fn a_drain_that_found_nobody_queued_ends_while_another_thread_releases() {
crate::sync::loom_model::a_drain_that_found_nobody_queued_ends_while_another_thread_releases();
}
#[test]
#[should_panic(expected = "over a queue with nobody in it")]
fn calibration_a_release_that_dirties_keeps_an_empty_drain_passing() {
crate::sync::loom_model::calibration_a_release_that_dirties_keeps_an_empty_drain_passing();
}
#[test]
#[should_panic(expected = "Causality violation")]
fn calibration_an_unguarded_write_is_caught() {
explore("calibration_an_unguarded_write_is_caught", 3, 1, || {
let cell = Arc::new(UnsafeCell::new(0usize));
let other = {
let cell = Arc::clone(&cell);
thread::spawn(move || bump(&cell))
};
bump(&cell);
other.join().expect("other");
});
}