Memory Manipulation
High
- Category
- Memory Poisoning
- Content
## tokio::sync::Notify and the Notified future `Notify` is the cheapest "wake one waiter" primitive in Tokio. Reach for it when you have a clear state-change event but no value to transfer (a channel would be the wrong tool) and no shared count to track (a `Semaphore` would be overkill). The lost-wakeup hazard: `Notify` permits coalesce — if two notifications arrive before any task calls `notified().await`, only one wakeup remains. **You must create the `Notified` future before re-checking the state**; otherwise a notification arriving between the state check and the `.notified().await` will appear as no notification at all.
- Confidence
- 80% confidence
- Finding
- clear state
