
+ fn await_fd(fd: FD, read: bool, write: bool) PollEvent {
    let current = current_coro
    if isset(current) {
        return current.await_fd(fd, read, write)
    }
    return 0
}

+ fn yield() {
    let current = current_coro
    if isset(current) {
        current.await_last()
    }
}

+ fn await_coro(coro: Coro) {
    let current = current_coro
    if isset(current) {
        current.await_coro(coro)
    }
}

fn throw(code: u32, msg: String) {
    let current = current_coro
    if isset(current) {
        current.error_code = code
        current.error_msg = msg
        current.complete()
        return
    }
    panic("Using 'coro:throw' without being inside a coroutine")
}
