diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2020-10-01 01:12:08 +0200 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2020-10-02 09:47:08 +0200 |
| commit | dc81cbdcb14bfaed773f0cd32f050caa108938e2 (patch) | |
| tree | 219251bdd2578f3d3fd63d8bb406c4d386f81e24 /library/std/src | |
| parent | 4f1353e54f9cdca82487b5e69f94e54047d8ea2f (diff) | |
| download | rust-dc81cbdcb14bfaed773f0cd32f050caa108938e2.tar.gz rust-dc81cbdcb14bfaed773f0cd32f050caa108938e2.zip | |
No longer put windows mutexes in a box.
Windows SRW locks are movable (while not borrowed) according to their documentation.
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sys/windows/mutex.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/library/std/src/sys/windows/mutex.rs b/library/std/src/sys/windows/mutex.rs index fb6bb9583e2..fa51b006c34 100644 --- a/library/std/src/sys/windows/mutex.rs +++ b/library/std/src/sys/windows/mutex.rs @@ -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 {} |
