tokio-rs / loom

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

Add access guards to `UnsafeCell` #219

Closed hawkw closed 2 years ago

hawkw commented 3 years ago

This branch adds the ability to access an UnsafeCell by returning a guard that tracks the lifetime of an *mut T or *const T. This allows pointers to UnsafeCells to be stored in data structures, or returned as part of a guard in user code, while still participating in Loom's access tracking.

This branch still needs some tests & docs improvements, but I'm opening it as a draft for now to make sure this is the right approach.

hawkw commented 2 years ago

Anything I can do to help move this forwards? It would be really nice to have... (cc @carllerche)