diff options
| author | Vexu <15308111+Vexu@users.noreply.github.com> | 2019-11-13 00:45:37 +0200 |
|---|---|---|
| committer | Vexu <15308111+Vexu@users.noreply.github.com> | 2019-11-13 00:52:15 +0200 |
| commit | f0c94d95dde320ba5e7509dc1499b33e54a1c951 (patch) | |
| tree | 0a2d9acdfa2a066c0fcee6d893747ee731a5083b /lib/std/event/future.zig | |
| parent | 110ef2e52825656fc048cba020f0fc36a1e58d13 (diff) | |
| download | zig-f0c94d95dde320ba5e7509dc1499b33e54a1c951.tar.gz zig-f0c94d95dde320ba5e7509dc1499b33e54a1c951.zip | |
use @atomicStore in std lib
Diffstat (limited to 'lib/std/event/future.zig')
| -rw-r--r-- | lib/std/event/future.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/event/future.zig b/lib/std/event/future.zig index 43593b348a..5261db990c 100644 --- a/lib/std/event/future.zig +++ b/lib/std/event/future.zig @@ -62,12 +62,12 @@ pub fn Future(comptime T: type) type { pub async fn start(self: *Self) ?*T { const state = @cmpxchgStrong(Available, &self.available, .NotStarted, .Started, .SeqCst, .SeqCst) orelse return null; switch (state) { - 1 => { + .Started => { const held = self.lock.acquire(); held.release(); return &self.data; }, - 2 => return &self.data, + .Finished => return &self.data, else => unreachable, } } |
