未验证 提交 ab5a71b0 编写于 作者: K kennytm 提交者: GitHub

Rollup merge of #53311 - RalfJung:windows-mutex, r=retep998

Window Mutex: Document that we properly initialize the SRWLock

See https://github.com/rust-lang/rust/issues/35836
......@@ -58,6 +58,8 @@ pub unsafe fn raw(m: &Mutex) -> c::PSRWLOCK {
impl Mutex {
pub const fn new() -> Mutex {
Mutex {
// This works because SRWLOCK_INIT is 0 (wrapped in a struct), so we are also properly
// initializing an SRWLOCK here.
lock: AtomicUsize::new(0),
held: UnsafeCell::new(false),
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册