commit 29057e5511ed007ee8db8306e89b674384c35964 (tree)
parent d3f628907a6b9e5b863c9d5235e6dadf57f42ca2
Author: kristopher tate <kt@connectfree.co.jp>
Date: Sun, 29 Jul 2018 17:12:33 +0900
std/event/channel.zig: remove promise_symbol from suspend and use @handle();
Tracking Issue #1296 ;
Diffstat:
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/std/event/channel.zig b/std/event/channel.zig
@@ -71,10 +71,10 @@ pub fn Channel(comptime T: type) type {
/// puts a data item in the channel. The promise completes when the value has been added to the
/// buffer, or in the case of a zero size buffer, when the item has been retrieved by a getter.
pub async fn put(self: *SelfChannel, data: T) void {
- suspend |handle| {
+ suspend {
var my_tick_node = Loop.NextTickNode{
.next = undefined,
- .data = handle,
+ .data = @handle(),
};
var queue_node = std.atomic.Queue(PutNode).Node{
.data = PutNode{
@@ -96,10 +96,10 @@ pub fn Channel(comptime T: type) type {
// TODO integrate this function with named return values
// so we can get rid of this extra result copy
var result: T = undefined;
- suspend |handle| {
+ suspend {
var my_tick_node = Loop.NextTickNode{
.next = undefined,
- .data = handle,
+ .data = @handle(),
};
var queue_node = std.atomic.Queue(GetNode).Node{
.data = GetNode{