#2558 adds some tests designed to run with loom. Doing so requires enabling the rust configuration string "loom", which means rebuilding the relevant pieces of rust code with that config enabled. Right now there are comments in the code describing how to do this manually.
It'd be nice to automate this; e.g. add support to our setup script for running these tests and maybe run them in our continuous integration testing.
Before doing that it might make sense to move code with loom test (currently SelfContainedMutex, but later maybe our custom semaphore and spinlock) into their own crate with minimal dependencies, to minimize how much code needs to be rebuilt with RUSTFLAGS="--cfg loom"