tokio-rs / loom

Concurrency permutation testing tool for Rust.
MIT License
2.08k stars 110 forks source link

Missing SyncUnsafeCell #333

Open Pr0methean opened 8 months ago

Pr0methean commented 8 months ago

I'm trying to use Loom to test a concurrent byte ring buffer, but it currently doesn't have an equivalent of core::cell::SyncUnsafeCell (which I use to hold the buffer so that the readers and writer can borrow different byte ranges).

NB: This project is also affected by #156, since the writer uses a weak reference to detect when the readers have been dropped.

taiki-e commented 8 months ago

loom does not usually provide an equivalent of the standard library's unstable API. And you can easily implement this by writing a simple wrapper of UnsafeCell.