Commit 51fff9fa82
Changed files (2)
std
os
windows
std/os/windows/kernel32.zig
@@ -261,3 +261,7 @@ pub const PINIT_ONCE_FN = ?extern fn(InitOnce: *RTL_RUN_ONCE, Parameter: ?PVOID,
pub const RTL_RUN_ONCE = extern struct {
Ptr: PVOID,
};
+
+pub const INIT_ONCE_STATIC_INIT = RTL_RUN_ONCE {
+ .Ptr = null,
+};
\ No newline at end of file
std/mutex.zig
@@ -76,7 +76,7 @@ pub const Mutex = switch(builtin.os) {
pub fn init() Mutex {
return Mutex {
.lock = undefined,
- .init_once = undefined,
+ .init_once = windows.INIT_ONCE_STATIC_INIT,
};
}
@@ -87,7 +87,7 @@ pub const Mutex = switch(builtin.os) {
) windows.BOOL {
var lock = @ptrCast(
*windows.CRITICAL_SECTION,
- @alignCast(@alignOf(*windows.CRITICAL_SECTION), ctx.?)
+ @alignCast(@alignOf(*windows.CRITICAL_SECTION), Context.?)
);
windows.InitializeCriticalSection(lock);
return windows.TRUE;