zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 148c887ace66ea829f7a7c45a2925532e7675e4f (tree)
parent 50af87a9e32e39a948d1dffdc4041d88db3f5313
Author: BinaryWarlock <unknown>
Date:   Wed,  6 Jan 2021 16:06:40 +0200

spinlock: Default SpinLock.state to .Unlocked to allow default struct initialization

std.Mutex, which is struct initialized, is possibly defined to be std.SpinLock.

Diffstat:
Mlib/std/spinlock.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/std/spinlock.zig b/lib/std/spinlock.zig @@ -7,7 +7,7 @@ const std = @import("std.zig"); const builtin = @import("builtin"); pub const SpinLock = struct { - state: State, + state: State = .Unlocked, const State = enum(u8) { Unlocked,