mirror of
https://github.com/fluencelabs/musl
synced 2025-05-29 23:51:34 +00:00
have new timer threads unblock their own SIGTIMER
unblocking it in the pthread_once init function is not sufficient, since multiple threads, some of them with the signal blocked, could already exist before this is called; timers started from such threads would be non-functional.
This commit is contained in:
parent
7c6c290695
commit
a7f18a5529
@ -55,8 +55,6 @@ static void install_handler()
|
|||||||
.sa_flags = SA_SIGINFO | SA_RESTART
|
.sa_flags = SA_SIGINFO | SA_RESTART
|
||||||
};
|
};
|
||||||
__libc_sigaction(SIGTIMER, &sa, 0);
|
__libc_sigaction(SIGTIMER, &sa, 0);
|
||||||
__syscall(SYS_rt_sigprocmask, SIG_UNBLOCK,
|
|
||||||
SIGTIMER_SET, 0, _NSIG/8);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *start(void *arg)
|
static void *start(void *arg)
|
||||||
@ -72,6 +70,8 @@ static void *start(void *arg)
|
|||||||
|
|
||||||
pthread_barrier_wait(&args->b);
|
pthread_barrier_wait(&args->b);
|
||||||
if ((id = self->timer_id) >= 0) {
|
if ((id = self->timer_id) >= 0) {
|
||||||
|
__syscall(SYS_rt_sigprocmask, SIG_UNBLOCK,
|
||||||
|
SIGTIMER_SET, 0, _NSIG/8);
|
||||||
__wait(&self->timer_id, 0, id, 1);
|
__wait(&self->timer_id, 0, id, 1);
|
||||||
__syscall(SYS_timer_delete, id);
|
__syscall(SYS_timer_delete, id);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user