| 17 | static _Atomic int sum; |
| 18 | |
| 19 | void *ThreadMain(void *arg) { |
| 20 | for (int i = 0; i < TOTAL; i++) { |
| 21 | // wait for a change, so we see interleaved processing. |
| 22 | int last = ++sum; |
| 23 | while (sum == last) {} |
| 24 | } |
| 25 | pthread_exit((void*)TOTAL); |
| 26 | } |
| 27 | |
| 28 | pthread_t thread[NUM_THREADS]; |
| 29 |
nothing calls this directly
no outgoing calls
no test coverage detected