| 24 | } |
| 25 | |
| 26 | int main(void) { |
| 27 | char *data = (char *)malloc(100); |
| 28 | pthread_t threads[THREADCOUNT]; |
| 29 | threadinfo_t args[THREADCOUNT]; |
| 30 | int rc; |
| 31 | |
| 32 | for (int i = 0; i < THREADCOUNT; ++i) { |
| 33 | args[i].tid = i; |
| 34 | args[i].data = data; |
| 35 | pthread_create(&threads[i], NULL, thread_main, (void *)&args[i]); |
| 36 | } |
| 37 | |
| 38 | for (int i = 0; i < THREADCOUNT; ++i) { |
| 39 | pthread_join(threads[i], NULL); |
| 40 | } |
| 41 | |
| 42 | printf("%d\n", ((int *)data)[0]); |
| 43 | } |
nothing calls this directly
no outgoing calls
no test coverage detected