| author | |
| committer | |
| log | 96a94e7da933dafec25356c435f5725c3cb0ce04 |
| tree | 5227e8bb2321f27bfd908cd8a601b3360aca19bb |
| parent | ac0a87d58d72a8c1fbb9b0af2d3818075729d85a |
Tracking Issue #1296 ;4 files changed, 6 insertions(+), 12 deletions(-)
std/event/future.zig+3-6| ... | ... | @@ -101,8 +101,7 @@ test "std.event.Future" { |
| 101 | 101 | |
| 102 | 102 | async fn testFuture(loop: *Loop) void { |
| 103 | 103 | suspend { |
| 104 | var h: promise = @handle(); | |
| 105 | resume h; | |
| 104 | resume @handle(); | |
| 106 | 105 | } |
| 107 | 106 | var future = Future(i32).init(loop); |
| 108 | 107 | |
| ... | ... | @@ -117,16 +116,14 @@ async fn testFuture(loop: *Loop) void { |
| 117 | 116 | |
| 118 | 117 | async fn waitOnFuture(future: *Future(i32)) i32 { |
| 119 | 118 | suspend { |
| 120 | var h: promise = @handle(); | |
| 121 | resume h; | |
| 119 | resume @handle(); | |
| 122 | 120 | } |
| 123 | 121 | return (await (async future.get() catch @panic("memory"))).*; |
| 124 | 122 | } |
| 125 | 123 | |
| 126 | 124 | async fn resolveFuture(future: *Future(i32)) void { |
| 127 | 125 | suspend { |
| 128 | var h: promise = @handle(); | |
| 129 | resume h; | |
| 126 | resume @handle(); | |
| 130 | 127 | } |
| 131 | 128 | future.data = 6; |
| 132 | 129 | future.resolve(); |
std/event/group.zig+1-2| ... | ... | @@ -57,8 +57,7 @@ pub fn Group(comptime ReturnType: type) type { |
| 57 | 57 | suspend { |
| 58 | 58 | var my_node: Stack.Node = undefined; |
| 59 | 59 | node.* = &my_node; |
| 60 | var h: promise = @handle(); | |
| 61 | resume h; | |
| 60 | resume @handle(); | |
| 62 | 61 | } |
| 63 | 62 | |
| 64 | 63 | // TODO this allocation elision should be guaranteed because we await it in |
std/event/lock.zig+1-2| ... | ... | @@ -142,8 +142,7 @@ test "std.event.Lock" { |
| 142 | 142 | async fn testLock(loop: *Loop, lock: *Lock) void { |
| 143 | 143 | // TODO explicitly put next tick node memory in the coroutine frame #1194 |
| 144 | 144 | suspend { |
| 145 | var h: promise = @handle(); | |
| 146 | resume h; | |
| 145 | resume @handle(); | |
| 147 | 146 | } |
| 148 | 147 | const handle1 = async lockRunner(lock) catch @panic("out of memory"); |
| 149 | 148 | var tick_node1 = Loop.NextTickNode{ |
std/event/tcp.zig+1-2| ... | ... | @@ -142,8 +142,7 @@ test "listen on a port, send bytes, receive bytes" { |
| 142 | 142 | std.debug.panic("unable to handle connection: {}\n", err); |
| 143 | 143 | }; |
| 144 | 144 | suspend { |
| 145 | var h: promise = @handle(); | |
| 146 | cancel h; | |
| 145 | cancel @handle(); | |
| 147 | 146 | } |
| 148 | 147 | } |
| 149 | 148 | async fn errorableHandler(self: *Self, _addr: *const std.net.Address, _socket: *const std.os.File) !void { |