std/event/tcp.zig: remove promise_symbol from suspend and use @handle();

Tracking Issue #1296 ;
master
kristopher tate 2018-07-29 17:14:35 +09:00
parent a3705b4251
commit 9fe140abad
1 changed files with 5 additions and 4 deletions

View File

@ -88,8 +88,8 @@ pub const Server = struct {
},
error.ProcessFdQuotaExceeded => {
errdefer std.os.emfile_promise_queue.remove(&self.waiting_for_emfile_node);
suspend |p| {
self.waiting_for_emfile_node = PromiseNode.init(p);
suspend {
self.waiting_for_emfile_node = PromiseNode.init( @handle() );
std.os.emfile_promise_queue.append(&self.waiting_for_emfile_node);
}
continue;
@ -141,8 +141,9 @@ test "listen on a port, send bytes, receive bytes" {
(await next_handler) catch |err| {
std.debug.panic("unable to handle connection: {}\n", err);
};
suspend |p| {
cancel p;
suspend {
var h: promise = @handle();
cancel h;
}
}
async fn errorableHandler(self: *Self, _addr: *const std.net.Address, _socket: *const std.os.File) !void {