source:
CIVL/mods/dev.civl.com/examples/experimental/pthread.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 217 bytes | |
| Rev | Line | |
|---|---|---|
| [fa402b5] | 1 | #include <pthread.h> |
| 2 | ||
| 3 | #define N 10 | |
| 4 | pthread_t threads[N]; | |
| 5 | ||
| 6 | void* run(void *arg){ | |
| 7 | pthread_exit(NULL); | |
| 8 | return NULL; | |
| 9 | } | |
| 10 | ||
| 11 | int main(void){ | |
| 12 | for(int i=0; i<N; i++) | |
| 13 | pthread_create(&threads[i], NULL, run, (void*)i); | |
| 14 | } |
Note:
See TracBrowser
for help on using the repository browser.
