also looking at this
fix(sync): stop craft's locks busy-waiting
#80
3 files
+229
-23
| @@ -6,6 +6,11 @@ const global_state = ; | ||
| 6 | 6 | /// Thread-safe access is provided through global_state. |
| 7 | 7 | /// Initialize the global Io context. Must be called once at startup from main(). |
| 8 | 8 | pub 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); | |
| 9 | 14 | global_state.instance.setIo(io); |
| 10 | 15 | } |
| 11 | 16 | |