1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

abort programm if pthread_create failed

This commit is contained in:
Stefan Lankes 2015-12-30 02:16:24 +01:00
parent 04effe2b86
commit 600425c57e

View file

@ -20,10 +20,10 @@ int main(int argc, char** argv)
for(i=0; i<MAX_THREADS; i++) {
param[i] = i;
ret = pthread_create(threads+i, NULL, thread_func, param+i);
if (ret)
if (ret) {
printf("Thread creation failed! error = %d\n", ret);
else
printf("Create thread %d\n", i);
return ret;
} else printf("Create thread %d\n", i);
}
/* wait until all threads have terminated */