Skip to content

Guarantee that native tasks wait for children #11315

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

Merged
merged 1 commit into from
Jan 6, 2014

Conversation

alexcrichton
Copy link
Member

There was a scheduling race where a child may not increment the global task
count before the parent exits, and the parent would then think that there are no
more tasks left.

Closes #11039

@huonw
Copy link
Member

huonw commented Jan 5, 2014

Is it worth having a test? e.g. a run-pass one like:

extern mod native;

static mut set: bool = false;
#[start]
fn start(argc: int, argv: **u8) -> int {
    native::start(argc, argv, proc() spawn(proc() unsafe {set = true}));

    if unsafe {set} {0} else {1}
}

@alexcrichton
Copy link
Member Author

Excellent idea, I have added a test.

There was a scheduling race where a child may not increment the global task
count before the parent exits, and the parent would then think that there are no
more tasks left.
bors added a commit that referenced this pull request Jan 6, 2014
There was a scheduling race where a child may not increment the global task
count before the parent exits, and the parent would then think that there are no
more tasks left.

Closes #11039
@bors bors merged commit 9c8813f into rust-lang:master Jan 6, 2014
@alexcrichton alexcrichton deleted the issue-11309 branch January 7, 2014 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SharedChan is not Freeze
3 participants