ReviewOS

also looking at this

craft-native/craft

fix(sync): stop craft's locks busy-waiting

#80
Merged glennmichael123 wants to merge fix/blocking-primitives into main
3 files +229 -23
packages/zig/src/io_context.zigmodified+5-0
Changes to packages/zig/src/io_context.zig
@@ -6,6 +6,11 @@ const global_state = ;
66/// Thread-safe access is provided through global_state.
77/// Initialize the global Io context. Must be called once at startup from main().
88pub fn init(io: std.Io) void {
9 // First, and before `global_state` — which locks one of these mutexes to
10 // answer `get()`. Handing the `Io` to the primitives here rather than
11 // having them ask for it is what keeps a lock acquisition from recursing
12 // into the lock it is acquiring.
13 .install(io);
914 global_state.instance.setIo(io);
1015}
1116