mirror of
https://github.com/fabro-sh/fabro.git
synced 2026-09-05 08:10:39 +00:00
Add clarifying comment to EventEmitter::emit() snapshot behavior
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
e2f884df23
commit
b22862d04c
1 changed files with 1 additions and 0 deletions
|
|
@ -1062,6 +1062,7 @@ impl EventEmitter {
|
|||
event.trace();
|
||||
// Clone the listener list so we don't hold the lock during dispatch.
|
||||
// This prevents deadlocks if a listener calls emit() reentrantly.
|
||||
// Note: listeners added during this emit() won't receive the current event.
|
||||
let snapshot: Vec<EventListener> = self
|
||||
.listeners
|
||||
.lock()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue