[][src]Function testbench::concurrent_test_2

pub fn concurrent_test_2(f1: impl FnOnce() + Send, f2: impl FnOnce() + Send)

Test that running two operations concurrently works

When testing multi-threaded constructs, such as synchronization primitives, checking that the code works when run sequentially is insufficient. Concurrent interactions must also be tested, by running some operations in parallel across multiple threads.

Ideally, this function would take as input a variable-size set of functors to be run in parallel. Since Rust does not support variadic generics yet, however, multiple versions of this function must be provided, each associated with a different functor tuple size.

Panics

This function will propagate panics from the inner functors.