summaryrefslogtreecommitdiffstats
path: root/tokio/tests/sync_notify.rs
AgeCommit message (Collapse)Author
2020-11-16sync: add `Notify::notify_waiters` (#3098)Zahari Dichev
This PR makes `Notify::notify_waiters` public. The method already exists, but it changes the way `notify_waiters`, is used. Previously in order for the consumer to register interest, in a notification triggered by `notify_waiters`, the `Notified` future had to be polled. This introduced friction when using the api as the future had to be pinned before polled. This change introduces a counter that tracks how many times `notified_waiters` has been called. Upon creation of the future the number of times is loaded. When first polled the future compares this number with the count state of the `Notify` type. This avoids the need for registering the waiter upfront. Fixes: #3066
2020-09-07sync: rename `Notify::notify()` -> `notify_one()` (#2822)Juan Alvarez
Closes: #2813
2020-02-26sync: adds Notify for basic task notification (#2210)Carl Lerche
`Notify` provides a synchronization primitive similar to thread park / unpark, except for tasks.