83 |
|
|
84 |
thread_lock_write (& send_port->lock); |
thread_lock_write (& send_port->lock); |
85 |
|
|
86 |
|
/* If port belongs to a port set -- use that message queue |
87 |
|
instead. For a short time we must hold both locks. */ |
88 |
|
if (send_port->pset) |
89 |
|
{ |
90 |
|
struct ipc_port *member = send_port; |
91 |
|
|
92 |
|
thread_lock_read (& send_port->pset->lock); |
93 |
|
send_port = send_port->pset; |
94 |
|
thread_lock_unlock (&member->lock); |
95 |
|
} |
96 |
|
|
97 |
/* If there are a waiting thread we try to pass the message |
/* If there are a waiting thread we try to pass the message |
98 |
directly to the thread without blocking. */ |
directly to the thread without blocking. */ |
99 |
|
|
122 |
goto retry_waiting_thread; |
goto retry_waiting_thread; |
123 |
} |
} |
124 |
|
|
125 |
|
assert (ikm); |
126 |
thread->ipc_result = KERN_SUCCESS; |
thread->ipc_result = KERN_SUCCESS; |
127 |
thread->ipc_kmsg = ikm; |
thread->ipc_kmsg = ikm; |
128 |
thread_unlock (thread); |
thread_unlock (thread); |
131 |
thread_lock_unlock (& send_port->lock); |
thread_lock_unlock (& send_port->lock); |
132 |
|
|
133 |
/* ??? interrupt thread? */ |
/* ??? interrupt thread? */ |
134 |
thread_wakeup ((int) send_port); |
thread_interrupt (thread); |
135 |
} |
} |
136 |
else |
else |
137 |
{ |
{ |
470 |
/* We have to cancel any pending callout. */ |
/* We have to cancel any pending callout. */ |
471 |
untimeout (timeout_receive, target); |
untimeout (timeout_receive, target); |
472 |
|
|
473 |
|
assert (kmsg); |
474 |
target->ipc_result = KERN_SUCCESS; |
target->ipc_result = KERN_SUCCESS; |
475 |
target->ipc_kmsg = kmsg; |
target->ipc_kmsg = kmsg; |
476 |
target->ipc_blocked_port = 0; |
target->ipc_blocked_port = 0; |