uipc_mqueue.c (dd1a6f53ac2b3e436405d3ae8156b35c4f275b5c) | uipc_mqueue.c (03f70aec67ab9e8449013f5c1b1e2d4e87acdd69) |
---|---|
1/*- 2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 1660 unchanged lines hidden (view full) --- 1669 mq->mq_curmsgs++; 1670 mq->mq_totalbytes += msg->msg_size; 1671 if (mq->mq_receivers) 1672 wakeup_one(&mq->mq_receivers); 1673 else if (mq->mq_notifier != NULL) 1674 mqueue_send_notification(mq); 1675 if (mq->mq_flags & MQ_RSEL) { 1676 mq->mq_flags &= ~MQ_RSEL; | 1/*- 2 * Copyright (c) 2005 David Xu <davidxu@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 1660 unchanged lines hidden (view full) --- 1669 mq->mq_curmsgs++; 1670 mq->mq_totalbytes += msg->msg_size; 1671 if (mq->mq_receivers) 1672 wakeup_one(&mq->mq_receivers); 1673 else if (mq->mq_notifier != NULL) 1674 mqueue_send_notification(mq); 1675 if (mq->mq_flags & MQ_RSEL) { 1676 mq->mq_flags &= ~MQ_RSEL; |
1677 selwakeuppri(&mq->mq_rsel, PSOCK); | 1677 selwakeup(&mq->mq_rsel); |
1678 } 1679 KNOTE_LOCKED(&mq->mq_rsel.si_note, 0); 1680 mtx_unlock(&mq->mq_mutex); 1681 return (0); 1682} 1683 1684/* 1685 * Send realtime a signal to process which registered itself --- 118 unchanged lines hidden (view full) --- 1804 error = 0; 1805 TAILQ_REMOVE(&mq->mq_msgq, *msg, msg_link); 1806 mq->mq_curmsgs--; 1807 mq->mq_totalbytes -= (*msg)->msg_size; 1808 if (mq->mq_senders) 1809 wakeup_one(&mq->mq_senders); 1810 if (mq->mq_flags & MQ_WSEL) { 1811 mq->mq_flags &= ~MQ_WSEL; | 1678 } 1679 KNOTE_LOCKED(&mq->mq_rsel.si_note, 0); 1680 mtx_unlock(&mq->mq_mutex); 1681 return (0); 1682} 1683 1684/* 1685 * Send realtime a signal to process which registered itself --- 118 unchanged lines hidden (view full) --- 1804 error = 0; 1805 TAILQ_REMOVE(&mq->mq_msgq, *msg, msg_link); 1806 mq->mq_curmsgs--; 1807 mq->mq_totalbytes -= (*msg)->msg_size; 1808 if (mq->mq_senders) 1809 wakeup_one(&mq->mq_senders); 1810 if (mq->mq_flags & MQ_WSEL) { 1811 mq->mq_flags &= ~MQ_WSEL; |
1812 selwakeuppri(&mq->mq_wsel, PSOCK); | 1812 selwakeup(&mq->mq_wsel); |
1813 } 1814 KNOTE_LOCKED(&mq->mq_wsel.si_note, 0); 1815 } 1816 if (mq->mq_notifier != NULL && mq->mq_receivers == 0 && 1817 !TAILQ_EMPTY(&mq->mq_msgq)) { 1818 mqueue_send_notification(mq); 1819 } 1820 mtx_unlock(&mq->mq_mutex); --- 434 unchanged lines hidden (view full) --- 2255 if (fp->f_ops == &mqueueops) { 2256 mq = FPTOMQ(fp); 2257 mtx_lock(&mq->mq_mutex); 2258 notifier_remove(td->td_proc, mq, fd); 2259 2260 /* have to wakeup thread in same process */ 2261 if (mq->mq_flags & MQ_RSEL) { 2262 mq->mq_flags &= ~MQ_RSEL; | 1813 } 1814 KNOTE_LOCKED(&mq->mq_wsel.si_note, 0); 1815 } 1816 if (mq->mq_notifier != NULL && mq->mq_receivers == 0 && 1817 !TAILQ_EMPTY(&mq->mq_msgq)) { 1818 mqueue_send_notification(mq); 1819 } 1820 mtx_unlock(&mq->mq_mutex); --- 434 unchanged lines hidden (view full) --- 2255 if (fp->f_ops == &mqueueops) { 2256 mq = FPTOMQ(fp); 2257 mtx_lock(&mq->mq_mutex); 2258 notifier_remove(td->td_proc, mq, fd); 2259 2260 /* have to wakeup thread in same process */ 2261 if (mq->mq_flags & MQ_RSEL) { 2262 mq->mq_flags &= ~MQ_RSEL; |
2263 selwakeuppri(&mq->mq_rsel, PSOCK); | 2263 selwakeup(&mq->mq_rsel); |
2264 } 2265 if (mq->mq_flags & MQ_WSEL) { 2266 mq->mq_flags &= ~MQ_WSEL; | 2264 } 2265 if (mq->mq_flags & MQ_WSEL) { 2266 mq->mq_flags &= ~MQ_WSEL; |
2267 selwakeuppri(&mq->mq_wsel, PSOCK); | 2267 selwakeup(&mq->mq_wsel); |
2268 } 2269 mtx_unlock(&mq->mq_mutex); 2270 } 2271} 2272 2273static void 2274mq_proc_exit(void *arg __unused, struct proc *p) 2275{ --- 198 unchanged lines hidden --- | 2268 } 2269 mtx_unlock(&mq->mq_mutex); 2270 } 2271} 2272 2273static void 2274mq_proc_exit(void *arg __unused, struct proc *p) 2275{ --- 198 unchanged lines hidden --- |