File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -256,6 +256,20 @@ impl<T> Event<T> {
256
256
///
257
257
/// In certain cases, this function emits a `SeqCst` fence before notifying listeners.
258
258
///
259
+ /// This function returns the number of [`EventListener`]s that were notified by this call.
260
+ ///
261
+ /// # Caveats
262
+ ///
263
+ /// If the `std` feature is disabled, the notification will be delayed under high contention,
264
+ /// such as when another thread is taking a while to `notify` the event. In this circumstance,
265
+ /// this function will return `0` instead of the number of listeners actually notified. Therefore
266
+ /// if the `std` feature is disabled the return value of this function should not be relied upon
267
+ /// for soundness and should be used only as a hint.
268
+ ///
269
+ /// If the `std` feature is enabled, no spurious returns are possible, since the `std`
270
+ /// implementation uses system locking primitives to ensure there is no unavoidable
271
+ /// contention.
272
+ ///
259
273
/// # Examples
260
274
///
261
275
/// Use the default notification strategy:
You can’t perform that action at this time.
0 commit comments