MCPcopy Create free account
hub / github.com/JRickey/BattleShip / worker

Function worker

port/coroutine_test.cpp:32–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 do { if (!(cond)) { fprintf(stderr, "FAIL %s:%d %s\n", __FILE__, __LINE__, #cond); std::exit(1); } } while (0)
31
32void worker(void *arg) {
33 int id = (int)(intptr_t)arg;
34 for (int i = 0; i < 3; i++) {
35 g_seq[g_seq_n++] = id * 10 + i;
36 port_coroutine_yield();
37 }
38}
39
40/* Round-robin alternation: two coroutines, three yields each. The
41 * expected interleave is a0,b0,a1,b1,a2,b2 because the main loop

Callers

nothing calls this directly

Calls 1

port_coroutine_yieldFunction · 0.70

Tested by

no test coverage detected