Skip to content

sync: Fail with init semaphore count < 0 #15781

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
Jul 24, 2014

Conversation

alexcrichton
Copy link
Member

Semaphores are not currently designed to handle this case correctly, leading to
very strange behavior. Semaphores as written are intended to count resources
and it's not possible to have a negative number of resources.

This alters the behavior and documentation to note that the task will be failed
if the initial count is 0.

Closes #15758

Semaphores are not currently designed to handle this case correctly, leading to
very strange behavior. Semaphores as written are intended to count *resources*
and it's not possible to have a negative number of resources.

This alters the behavior and documentation to note that the task will be failed
if the initial count is 0.

Closes rust-lang#15758
@alexcrichton
Copy link
Member Author

cc @bblum

@bblum
Copy link
Contributor

bblum commented Jul 18, 2014

r+

@aturon
Copy link
Member

aturon commented Jul 23, 2014

@bblum Note that the r+ has to be a comment on the tip of the commit, rather than on the PR. I've added an r=bblum to go ahead and push this through.

@bblum
Copy link
Contributor

bblum commented Jul 23, 2014

oh right, thanks

bors added a commit that referenced this pull request Jul 24, 2014
Semaphores are not currently designed to handle this case correctly, leading to
very strange behavior. Semaphores as written are intended to count *resources*
and it's not possible to have a negative number of resources.

This alters the behavior and documentation to note that the task will be failed
if the initial count is 0.

Closes #15758
@bors bors closed this Jul 24, 2014
@bors bors merged commit 3419e20 into rust-lang:master Jul 24, 2014
@alexcrichton alexcrichton deleted the issue-15758 branch July 24, 2014 17:48
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.

sync::Semaphore needs to require nonnegative initial resource count
4 participants