Skip to content

Commit 7c4738e

Browse files
committed
Fix merge issue
1 parent a6bb6d7 commit 7c4738e

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

library/std/src/sys/windows/mutex.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,10 @@ impl Mutex {
134134
0 => {}
135135
n => return n as *const _,
136136
}
137-
let inner = box Inner { remutex: ReentrantMutex::uninitialized(), held: Cell::new(false) };
138137
unsafe {
138+
let inner = box Inner { remutex: ReentrantMutex::uninitialized(), held: Cell::new(false) };
139139
inner.remutex.init();
140-
}
141-
}
142-
143-
unsafe fn flag_locked(&self) -> bool {
144-
// SAFETY: The caller must ensure that the mutex is not moved or copied
145-
unsafe {
140+
let inner = Box::into_raw(inner);
146141
match self.lock.compare_and_swap(0, inner as usize, Ordering::SeqCst) {
147142
0 => inner,
148143
n => {

0 commit comments

Comments
 (0)