Amanieu / parking_lot

Compact and efficient synchronization primitives for Rust. Also provides an API for creating custom synchronization primitives.
Apache License 2.0
2.76k stars 217 forks source link

RawMutex moving. #410

Open zakarumych opened 1 year ago

zakarumych commented 1 year ago

As far as I understand it RawMutex uses its current address as a key into parking_lot_core methods. Therefore RawMutex value itself cannot be moved while lock is acquired.

This is not a problem for a Mutex because it is borrowed while lock is held, preventing moving. But I don't see this in documentation for RawMutex that might be used directly.

Amanieu commented 1 year ago

That's a good point! Would you be willing to write up a doc PR>