After reading some documents, I realized SIGEV_NONE != NULL, also

fix code in mqueue_send_notification to handle SIGEV_NONE.
This commit is contained in:
David Xu 2005-12-05 04:41:32 +00:00
parent 9947b45978
commit 052ea11c71

View File

@ -1694,11 +1694,13 @@ mqueue_send_notification(struct mqueue *mq)
mtx_assert(&mq->mq_mutex, MA_OWNED);
nt = mq->mq_notifier;
p = nt->nt_proc;
PROC_LOCK(p);
if (!KSI_ONQ(&nt->nt_ksi))
psignal_event(p, &nt->nt_sigev, &nt->nt_ksi);
PROC_UNLOCK(p);
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);
PROC_UNLOCK(p);
}
mq->mq_notifier = NULL;
}
@ -2191,7 +2193,7 @@ mq_notify(struct thread *td, struct mq_notify_args *uap)
if (uap->sigev != NULL) {
if (mq->mq_notifier != NULL) {
error = EBUSY;
} else if (ev.sigev_notify != SIGEV_NONE) {
} else {
PROC_LOCK(p);
nt = notifier_search(p, uap->mqd);
if (nt == NULL) {