作者/来源:yixinu.com
栏目:运维/编程
日期:2020-03-24 18:46:20
#include#include #include void * foo(void * d) { return NULL; } int main() { int i=0; pthread_t thread; while(1){ if(pthread_create(&thread,NULL,foo,NULL)!=0) return 0; i++; printf("i=%d",i); } return 1; }
gcc -o test test.c -lpthread