* Send realtime a signal to process which registered itself * successfully by mq_notify. */
| 1816 | * successfully by mq_notify. |
| 1817 | */ |
| 1818 | static void |
| 1819 | mqueue_send_notification(struct mqueue *mq) |
| 1820 | { |
| 1821 | struct mqueue_notifier *nt; |
| 1822 | struct thread *td; |
| 1823 | struct proc *p; |
| 1824 | int error; |
| 1825 | |
| 1826 | mtx_assert(&mq->mq_mutex, MA_OWNED); |
| 1827 | nt = mq->mq_notifier; |
| 1828 | if (nt->nt_sigev.sigev_notify != SIGEV_NONE) { |
| 1829 | p = nt->nt_proc; |
| 1830 | error = sigev_findtd(p, &nt->nt_sigev, &td); |
| 1831 | if (error) { |
| 1832 | mq->mq_notifier = NULL; |
| 1833 | return; |
| 1834 | } |
| 1835 | if (!KSI_ONQ(&nt->nt_ksi)) { |
| 1836 | ksiginfo_set_sigev(&nt->nt_ksi, &nt->nt_sigev); |
| 1837 | tdsendsignal(p, td, nt->nt_ksi.ksi_signo, &nt->nt_ksi); |
| 1838 | } |
| 1839 | PROC_UNLOCK(p); |
| 1840 | } |
| 1841 | mq->mq_notifier = NULL; |
| 1842 | } |
| 1843 | |
| 1844 | /* |
| 1845 | * Get a message. if waitok is false, thread will not be |
no test coverage detected