MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / create_and_signal

Function create_and_signal

nodedb/src/data/eventfd.rs:115–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113
114 #[test]
115 fn create_and_signal() {
116 let efd = EventFd::new().unwrap();
117 let notifier = efd.notifier();
118
119 // No signals yet.
120 assert_eq!(efd.drain(), 0);
121
122 // Signal and drain.
123 notifier.notify();
124 assert_eq!(efd.drain(), 1);
125
126 // Drained — should be 0 again.
127 assert_eq!(efd.drain(), 0);
128 }
129
130 #[test]
131 fn multiple_signals_accumulate() {

Callers

nothing calls this directly

Calls 2

notifierMethod · 0.80
notifyMethod · 0.45

Tested by

no test coverage detected