Skip to content

Commit

Permalink
let fibers::Semaphore be documented as FIFO
Browse files Browse the repository at this point in the history
Summary: Its implementation wakes waiters in FIFO order and this property was unlikely ever to be changed. By Hyrum's Law, this property is now required. So let it be documented.

Differential Revision: D48069483

fbshipit-source-id: 67f6a71aa0c13513c49a72d9add036dc528f308b
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Aug 4, 2023
1 parent 4dcb3c6 commit 015c667
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions folly/fibers/Semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ namespace fibers {
/*
* Fiber-compatible semaphore. Will safely block fibers that wait when no
* tokens are available and wake fibers when signalled.
*
* Fair. Waiters are awoken in FIFO order. (Note: whether the callers see FIFO
* order depends on the executors, wrapping async types, and the existence of
* happens-before relationships between async wait operations.)
*/
class Semaphore {
public:
Expand Down

0 comments on commit 015c667

Please sign in to comment.