fixed initializer and typos
parent
35d93d22db
commit
51fff9fa82
|
@ -76,7 +76,7 @@ pub const Mutex = switch(builtin.os) {
|
||||||
pub fn init() Mutex {
|
pub fn init() Mutex {
|
||||||
return Mutex {
|
return Mutex {
|
||||||
.lock = undefined,
|
.lock = undefined,
|
||||||
.init_once = undefined,
|
.init_once = windows.INIT_ONCE_STATIC_INIT,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ pub const Mutex = switch(builtin.os) {
|
||||||
) windows.BOOL {
|
) windows.BOOL {
|
||||||
var lock = @ptrCast(
|
var lock = @ptrCast(
|
||||||
*windows.CRITICAL_SECTION,
|
*windows.CRITICAL_SECTION,
|
||||||
@alignCast(@alignOf(*windows.CRITICAL_SECTION), ctx.?)
|
@alignCast(@alignOf(*windows.CRITICAL_SECTION), Context.?)
|
||||||
);
|
);
|
||||||
windows.InitializeCriticalSection(lock);
|
windows.InitializeCriticalSection(lock);
|
||||||
return windows.TRUE;
|
return windows.TRUE;
|
||||||
|
|
|
@ -261,3 +261,7 @@ pub const PINIT_ONCE_FN = ?extern fn(InitOnce: *RTL_RUN_ONCE, Parameter: ?PVOID,
|
||||||
pub const RTL_RUN_ONCE = extern struct {
|
pub const RTL_RUN_ONCE = extern struct {
|
||||||
Ptr: PVOID,
|
Ptr: PVOID,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE {
|
||||||
|
.Ptr = null,
|
||||||
|
};
|
Loading…
Reference in New Issue