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/build.zigmodified+14-0
Changes to packages/zig/build.zig
@@ -768,6 +768,18 @@ pub fn build(b: *std.Build) void {
768768 });
769769 bridge_log_tests.root_module.link_libc = true;
770770
771 // The blocking primitives every other lock in craft is built on. They
772 // spun without yielding until now, so this is the first time they have
773 // been exercised at all.
774 const compat_mutex_tests = b.addTest(.{
775 .root_module = b.createModule(.{
776 .root_source_file = b.path("src/compat_mutex.zig"),
777 .target = target,
778 .optimize = optimize,
779 }),
780 });
781 compat_mutex_tests.root_module.link_libc = true;
782
771783 // The conformance test: what craft declares, against what it dispatches.
772784 const capability_conformance_tests = b.addTest(.{
773785 .root_module = b.createModule(.{
@@ -1139,6 +1151,7 @@ pub fn build(b: *std.Build) void {
11391151 const run_local_tls_tests = b.addRunArtifact(local_tls_tests);
11401152 const run_menu_roles_tests = b.addRunArtifact(menu_roles_tests);
11411153 const run_capabilities_tests = b.addRunArtifact(capabilities_tests);
1154 const run_compat_mutex_tests = b.addRunArtifact(compat_mutex_tests);
11421155 const run_bridge_log_tests = b.addRunArtifact(bridge_log_tests);
11431156 const run_log_unit_tests = b.addRunArtifact(log_unit_tests);
11441157 const run_bridge_shell_tests = b.addRunArtifact(bridge_shell_tests);
@@ -1263,6 +1276,7 @@ pub fn build(b: *std.Build) void {
12631276 test_step.dependOn(&run_local_tls_tests.step);
12641277 test_step.dependOn(&run_menu_roles_tests.step);
12651278 test_step.dependOn(&run_capabilities_tests.step);
1279 test_step.dependOn(&run_compat_mutex_tests.step);
12661280 test_step.dependOn(&run_bridge_log_tests.step);
12671281 test_step.dependOn(&run_log_unit_tests.step);
12681282 test_step.dependOn(&run_bridge_shell_tests.step);