MCPcopy Create free account
hub / github.com/NationalSecurityAgency/TraceAnalysis / main

Function main

examples/multithread/test-program/example.c:26–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26int 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected