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:
parent
04effe2b86
commit
600425c57e
1 changed files with 3 additions and 3 deletions
|
@ -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 */
|
||||
|
|
Loading…
Add table
Reference in a new issue