Bonjour, j'ai un petit probléme avec pthread_create().
Au bout d'un moment pthread_create refuse de créer un nouveau thread
voici mon code:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 #include <stdio.h> #include <pthread.h> static void* avms_TestThread(void *arg) { static int i; printf("Test Thread[%d] running ...\n", i++); printf("Test Thread close\n"); pthread_exit(NULL); } int main(int argc, char *argv[]) { int retval; pthread_t i_thread; while(1) { printf("Start Thread\n"); if((retval = pthread_create(&i_thread, NULL, avms_TestThread, NULL)) != 0) { printf("Can't create Thread Test!\n"); exit(0); } usleep(200000); } }