qubit_lock/monitor/notifier.rs
1/*******************************************************************************
2 *
3 * Copyright (c) 2025 - 2026 Haixing Hu.
4 *
5 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! Notification capability for monitor-style synchronization.
11
12/// Sends notification signals to waiters.
13///
14/// Notifications are coordination signals. They do not carry state by
15/// themselves, so condition waiters should always recheck the protected state
16/// after waking.
17pub trait Notifier {
18 /// Wakes one waiter if one is currently blocked.
19 fn notify_one(&self);
20
21 /// Wakes all current waiters.
22 fn notify_all(&self);
23}