Skip to content

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