No longer put windows mutexes in a box.

Windows SRW locks are movable (while not borrowed) according to their
documentation.
This commit is contained in:
Mara Bos 2020-10-01 01:12:08 +02:00
parent 4f1353e54f
commit dc81cbdcb1
1 changed files with 4 additions and 1 deletions

View File

@ -29,7 +29,10 @@ pub struct Mutex {
lock: AtomicUsize,
}
pub type MovableMutex = Box<Mutex>;
// Windows SRW Locks are movable (while not borrowed).
// ReentrantMutexes (in Inner) are not, but those are stored indirectly through
// a Box, so do not move when the Mutex it self is moved.
pub type MovableMutex = Mutex;
unsafe impl Send for Mutex {}
unsafe impl Sync for Mutex {}