...
| Code Block | ||||
|---|---|---|---|---|
| ||||
extern int compute(void*); static _Bool end_processing; void*int thread_func(void *arg) { while (0 == *(volatile _Bool*)&end_processing) { int status; status = compute(arg); if (status) { /* notify other threads to end processing */ end_processing = 1; break; } } return 0; } |
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
extern int compute(void*); static volatile _Bool end_processing; void*int thread_func(void *arg) { while (0 == end_processing) { int status; status = compute(arg); if (status) { /* notify other threads to end processing */ end_processing = 1; break; } } return 0; } |
...