Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unsafe property for coroutine creation #8

Closed
Xudong-Huang opened this issue Dec 26, 2017 · 1 comment
Closed

add unsafe property for coroutine creation #8

Xudong-Huang opened this issue Dec 26, 2017 · 1 comment

Comments

@Xudong-Huang
Copy link
Owner

Xudong-Huang commented Dec 26, 2017

add unsafe declaration for coroutine creation since it will trigger undefined behavior if user's code

  • direct or indirect access TLS
  • stack exceeding during execution

ref #6

this would break current test and usage.

Xudong-Huang added a commit that referenced this issue Dec 27, 2017
 - add `go!` macro for convenient usage
 - update all related test
 - update comment docs
Xudong-Huang added a commit that referenced this issue Dec 27, 2017
 - update go! macro to support these new invoke
 - update tests accordingly
@Xudong-Huang
Copy link
Owner Author

I introduce a go!() macro to avoid writing the unsafe block code, which is a little convenient.

macro_rules! go {
    ($func: expr) => { ... };
    ($builder: expr, $func: expr) => { ... };
    ($cqueue: expr, $token: expr, $func: expr) => { ... };
}

this macro is just a convenient wrapper for spawn. However the supplied coroutine block is not wrapped in unsafe block

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant