improve pthread_exit synchronization with functions targeting tid
[musl] / src / thread / pthread_getschedparam.c
index a994b63..05be424 100644 (file)
@@ -4,7 +4,7 @@ int pthread_getschedparam(pthread_t t, int *restrict policy, struct sched_param
 {
        int r;
        LOCK(t->killlock);
-       if (t->dead) {
+       if (!t->tid) {
                r = ESRCH;
        } else {
                r = -__syscall(SYS_sched_getparam, t->tid, param);