diff options
Diffstat (limited to 'sys/kern/uipc_mqueue.c')
-rw-r--r-- | sys/kern/uipc_mqueue.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/kern/uipc_mqueue.c b/sys/kern/uipc_mqueue.c index de65462..30c1aa9 100644 --- a/sys/kern/uipc_mqueue.c +++ b/sys/kern/uipc_mqueue.c @@ -1747,15 +1747,23 @@ static void mqueue_send_notification(struct mqueue *mq) { struct mqueue_notifier *nt; + struct thread *td; struct proc *p; + int error; mtx_assert(&mq->mq_mutex, MA_OWNED); nt = mq->mq_notifier; if (nt->nt_sigev.sigev_notify != SIGEV_NONE) { p = nt->nt_proc; - PROC_LOCK(p); - if (!KSI_ONQ(&nt->nt_ksi)) - psignal_event(p, &nt->nt_sigev, &nt->nt_ksi); + error = sigev_findtd(p, &nt->nt_sigev, &td); + if (error) { + mq->mq_notifier = NULL; + return; + } + if (!KSI_ONQ(&nt->nt_ksi)) { + ksiginfo_set_sigev(&nt->nt_ksi, &nt->nt_sigev); + tdsendsignal(p, td, nt->nt_ksi.ksi_signo, &nt->nt_ksi); + } PROC_UNLOCK(p); } mq->mq_notifier = NULL; |