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

Calling DispatchQueue::Barrier() with 0 timeout returns false #504

Closed
jnguyen75 opened this issue May 15, 2015 · 1 comment
Closed

Calling DispatchQueue::Barrier() with 0 timeout returns false #504

jnguyen75 opened this issue May 15, 2015 · 1 comment

Comments

@jnguyen75
Copy link
Contributor

When playing with DispatchQueueTest.Barrier line 77, the unit test would fail with std::chrono::nanoseconds was 1e4, but pass with 1e5

@codemercenary codemercenary changed the title Calling DispatchQueue::Barrier() with ~0 timeout returns false Calling DispatchQueue::Barrier() with 0 timeout returns false May 15, 2015
@codemercenary
Copy link
Contributor

DispatchQueue::Barrier should return true unconditionally for an empty dispatch queue.

codemercenary added a commit that referenced this issue May 16, 2015
When Barrier is called with a value of zero, the return value must be set according to the number of elements in the queue as of the time of the call.  Not only is this a good optimization, but it's also a way to allow consumers to easily poll the status of the queue.

Fixes #504
codemercenary added a commit that referenced this issue May 16, 2015
When Barrier is called with a value of zero, the return value must be set according to the number of elements in the queue as of the time of the call.  Not only is this a good optimization, but it's also a way to allow consumers to easily poll the status of the queue.

Fixes #504
codemercenary added a commit that referenced this issue May 18, 2015
When Barrier is called with a value of zero, the return value must be set according to the number of elements in the queue as of the time of the call.  Not only is this a good optimization, but it's also a way to allow consumers to easily poll the status of the queue.

Fixes #504
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

No branches or pull requests

2 participants