UnboundedQueue: Change try_dequeue variants to fail only if the queue is empty
authorMaged Michael <magedmichael@fb.com>
Sat, 16 Dec 2017 22:13:47 +0000 (14:13 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Sat, 16 Dec 2017 22:37:22 +0000 (14:37 -0800)
commitf4d97dc69a38d8fde40d90724455522774df77a3
tree24fabf0627ba35f562fa057a9700594bc22cbab5
parent124efa238dc51b331457c940e17aa9cb7c47a92e
UnboundedQueue: Change try_dequeue variants to fail only if the queue is empty

Summary:
The current semantics of try_dequeue variants can cause problems in cases where based on external dependencies the consumer is guaranteed that the queue is not empty and depends on the success of try_dequeue. See https://github.com/facebook/wangle/commit/abd07a06cae09efcd4347a9a019d59ae8a013c3f

This diff changes the semantics so that try_dequeue operations fail only if the queue is empty.

Reviewed By: yfeldblum

Differential Revision: D6586156

fbshipit-source-id: 25d6085e28d3e24034ecf6a8bafab51c95464b01
folly/concurrency/UnboundedQueue.h