Skip to content

Instantly share code, notes, and snippets.

@jamii

jamii/main.zig Secret

Last active May 16, 2021 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamii/293785ddac27003cd7189001eed5d44d to your computer and use it in GitHub Desktop.
Save jamii/293785ddac27003cd7189001eed5d44d to your computer and use it in GitHub Desktop.
var a_frame: anyframe = undefined;
fn a() void {
suspend {
a_frame = @frame();
}
}
fn b() u64 {
a();
return 1;
}
fn amain() void {
var b_frame = async b();
resume a_frame;
@import("std").debug.print("{}", .{await b_frame});
}
pub fn main() void {
nosuspend amain();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment