MCPcopy Create free account
hub / github.com/defold/defold / WaitForEventCount

Function WaitForEventCount

engine/dlib/src/test/test_mdns.cpp:262–274  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260 }
261
262 static bool WaitForEventCount(EventLog& event_log, dmMDNS::EventType event_type, const char* instance_name, uint32_t count, dmMDNS::HMDNS mdns, dmMDNS::HBrowser browser, uint32_t timeout_ms)
263 {
264 const uint64_t deadline = dmTime::GetMonotonicTime() + (uint64_t) timeout_ms * 1000ULL;
265 while (dmTime::GetMonotonicTime() < deadline)
266 {
267 if (event_log.CountInstance(event_type, instance_name) >= count)
268 {
269 return true;
270 }
271 Pump(mdns, browser, 1, 5 * 1000);
272 }
273 return event_log.CountInstance(event_type, instance_name) >= count;
274 }
275
276 static bool WaitForFlag(int32_atomic_t* flag, uint32_t iterations, uint32_t sleep_us)
277 {

Callers 1

TESTFunction · 0.85

Calls 3

PumpFunction · 0.85
CountInstanceMethod · 0.80
GetMonotonicTimeFunction · 0.50

Tested by

no test coverage detected