- err = pthread_create(&ipl_tid, NULL, &ipl_task, NULL);
- if (err != 0)
- printf("[ERROR] Cannot create IPL thread: [%s]", strerror(err));
- else {
- pthread_setname_np(ipl_tid, "pistorm: ipl");
- printf("IPL thread created successfully\n");
+ if (ipl_tid == 0) {
+ err = pthread_create(&ipl_tid, NULL, &ipl_task, NULL);
+ if (err != 0)
+ printf("[ERROR] Cannot create IPL thread: [%s]", strerror(err));
+ else {
+ pthread_setname_np(ipl_tid, "pistorm: ipl");
+ printf("IPL thread created successfully\n");
+ }