authorgravatar for kt@connectfree.co.jpkristopher tate <kt@connectfree.co.jp> 2018-07-29 17:13:42+09:00
committergravatar for kt@connectfree.co.jpkristopher tate <kt@connectfree.co.jp> 2018-08-02 16:59:11+09:00
logefec3a0e342be01f7cf74cf7906dd50b98e5aa97
treed333224a0e623b14fa5a68ed982886a0c2d1f200
parentb4ff464d39038fe840ed6fce3f73cd075fde25f2

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

Tracking Issue #1296 ;

1 files changed, 5 insertions(+), 4 deletions(-)

std/event/lock.zig+5-4
...@@ -90,10 +90,10 @@ pub const Lock = struct {...@@ -90,10 +90,10 @@ pub const Lock = struct {
90 }90 }
9191
92 pub async fn acquire(self: *Lock) Held {92 pub async fn acquire(self: *Lock) Held {
93 suspend |handle| {93 suspend {
94 // TODO explicitly put this memory in the coroutine frame #119494 // TODO explicitly put this memory in the coroutine frame #1194
95 var my_tick_node = Loop.NextTickNode{95 var my_tick_node = Loop.NextTickNode{
96 .data = handle,96 .data = @handle(),
97 .next = undefined,97 .next = undefined,
98 };98 };
9999
...@@ -141,8 +141,9 @@ test "std.event.Lock" {...@@ -141,8 +141,9 @@ test "std.event.Lock" {
141141
142async fn testLock(loop: *Loop, lock: *Lock) void {142async fn testLock(loop: *Loop, lock: *Lock) void {
143 // TODO explicitly put next tick node memory in the coroutine frame #1194143 // TODO explicitly put next tick node memory in the coroutine frame #1194
144 suspend |p| {144 suspend {
145 resume p;145 var h: promise = @handle();
146 resume h;
146 }147 }
147 const handle1 = async lockRunner(lock) catch @panic("out of memory");148 const handle1 = async lockRunner(lock) catch @panic("out of memory");
148 var tick_node1 = Loop.NextTickNode{149 var tick_node1 = Loop.NextTickNode{