MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / iter

Function iter

test/browser/test_async_mainloop.c:18–33  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16int nesting = 0;
17
18void iter() {
19 printf("frame: %d\n", ++counter);
20
21 // ensure we don't 'recurse' with the main loop sending us back in before the
22 // synchronous operation callback finishes the rest of this trace
23 assert(nesting == 0);
24 nesting++;
25 emscripten_sleep(500);
26 assert(nesting == 1);
27 nesting = 0;
28
29 if (counter == 10) {
30 finish(121); // if we got here without hitting any assertions, all is well
31 emscripten_cancel_main_loop();
32 }
33}
34
35int main() {
36 emscripten_set_main_loop(iter, 0, 0);

Callers

nothing calls this directly

Calls 3

printfFunction · 0.85
finishFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected