Commit 26e08d5701

kprotty <kbutcher6200@gmail.com>
2019-12-16 18:51:40
ResetEvent: use futex on linux when possible
1 parent ac5ba27
Changed files (1)
lib/std/reset_event.zig
@@ -14,10 +14,13 @@ const windows = os.windows;
 pub const ResetEvent = struct {
     os_event: OsEvent,
 
-    pub const OsEvent = if (builtin.single_threaded) DebugEvent else switch (builtin.os) {
-        .windows => AtomicEvent,
-        else => if (builtin.link_libc) PosixEvent else AtomicEvent,
-    };
+    pub const OsEvent = 
+        if (builtin.single_threaded)
+            DebugEvent
+        else if (builtin.link_libc and builtin.os != .windows and builtin.os != .linux)
+            PosixEvent
+        else
+            AtomicEvent;
 
     pub fn init() ResetEvent {
         return ResetEvent{ .os_event = OsEvent.init() };