1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! The agg-gui host waker, and the guard that guarantees it is uninstalled.
//!
//! agg-gui signals a reactive host from background threads through
//! `animation::set_host_waker`. Ours sends a winit user event, which wakes a
//! loop parked in `ControlFlow::Wait`.
//!
//! Two rules, both learned the hard way:
//!
//! * **Install only once the window and the GPU exist.** A waker installed
//! earlier can fire against an event loop that is about to be torn down by a
//! failed init.
//! * **Uninstall on every exit path.** The waker slot is process-global and
//! holds an `EventLoopProxy`; leaving a stale one behind after the loop ends
//! keeps the proxy alive and makes a later `run` in the same process signal
//! the wrong loop. That is what [`HostWakerGuard`] is for — it clears on
//! drop, so a clean exit, an error return and a panic all behave.
use EventLoopProxy;
/// Clears the installed host waker when dropped.
pub ;