So that the lockless reads do not see the task complete signal prior to
marking the task as successful. Otherwise, we falsely detect that the
thread trapped a signal and kill them all.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
t->func(t->arg);
pthread_mutex_lock(&t->mutex);
- t->func = NULL;
t->arg = NULL;
+ t->func = NULL;
pthread_cond_signal(&t->cond);
}
pthread_mutex_unlock(&t->mutex);
ERR(("%s: thread[%d] caught signal %d\n", __func__, n, sig));
pthread_mutex_lock(&threads[n].mutex);
- threads[n].func = NULL;
threads[n].arg = (void *)(intptr_t)sig;
+ threads[n].func = NULL;
pthread_cond_signal(&threads[n].cond);
pthread_mutex_unlock(&threads[n].mutex);