Handle thread creation error correctly

Change-Id: Iaa8811e245aa20ac107aef104847df3e455518f1


[ROCm/ROCR-Runtime commit: 4a0d50f415]
Bu işleme şunda yer alıyor:
Ramesh Errabolu
2019-08-01 17:19:18 -05:00
ebeveyn 466099ec20
işleme 568620e42e
+10 -1
Dosyayı Görüntüle
@@ -201,11 +201,20 @@ void TestGroupThreadCreate(test_group *t_group) {
thread_list[ii].test_cond = &(t_group->test_cond);
thread_list[ii].num_running_t = &(t_group->num_running_t);
int status = pthread_create(t_group->tid + ii, &(t_group->attr), worker, thread_list + ii);
if (status < 0) {
// Print error statements and break
if (status != 0) {
printf("pthread_create return value %d\n", status);
printf("pthread_create error at idx: %d of %d\n", ii, n_threads);
perror("pthread_create failed");
break;
}
}
// Update test group properties to
// accommodate thread creation error
t_group->num_test = ii;
t_group->n_threads = ii;
return;
}