mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 21:57:55 +00:00
Signal accounting in the explicit-reply path
Properly account signal count in the explicit-reply path (when source- client gets immediately unblocked by 'signal_session_component::submit'). This patch prevents the delivery of superfluous signals with num == 0.
This commit is contained in:
parent
defd6a9b58
commit
3d5cfde313
@ -241,6 +241,9 @@ Signal Signal_receiver::wait_for_signal()
|
|||||||
/* invalidate current signal in context */
|
/* invalidate current signal in context */
|
||||||
context->_curr_signal = Signal(0, 0);
|
context->_curr_signal = Signal(0, 0);
|
||||||
|
|
||||||
|
if (result.num() == 0)
|
||||||
|
PWRN("returning signal with num == 0");
|
||||||
|
|
||||||
/* return last received signal */
|
/* return last received signal */
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ void Signal_session_component::free_context(Signal_context_capability context_ca
|
|||||||
|
|
||||||
|
|
||||||
void Signal_session_component::submit(Signal_context_capability context_cap,
|
void Signal_session_component::submit(Signal_context_capability context_cap,
|
||||||
unsigned cnt)
|
unsigned cnt)
|
||||||
{
|
{
|
||||||
Signal_context_component *context;
|
Signal_context_component *context;
|
||||||
context = dynamic_cast<Signal_context_component *>
|
context = dynamic_cast<Signal_context_component *>
|
||||||
|
@ -29,6 +29,13 @@ void Signal_source_component::submit(Signal_context_component *context,
|
|||||||
Ipc_ostream *ostream,
|
Ipc_ostream *ostream,
|
||||||
int cnt)
|
int cnt)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* If the client does not block in 'wait_for_signal', the
|
||||||
|
* signal will be delivered as result of the next
|
||||||
|
* 'wait_for_signal' call.
|
||||||
|
*/
|
||||||
|
context->increment_signal_cnt(cnt);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If the client is blocking at the signal source (indicated by
|
* If the client is blocking at the signal source (indicated by
|
||||||
* the valid reply capability), we wake him up.
|
* the valid reply capability), we wake him up.
|
||||||
@ -43,17 +50,13 @@ void Signal_source_component::submit(Signal_context_component *context,
|
|||||||
* the reply capability.
|
* the reply capability.
|
||||||
*/
|
*/
|
||||||
_reply_cap = Untyped_capability();
|
_reply_cap = Untyped_capability();
|
||||||
|
context->reset_signal_cnt();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (!context->is_enqueued())
|
||||||
|
_signal_queue.enqueue(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* If the client does not block in 'wait_for_signal', the
|
|
||||||
* signal will be delivered as result of the next
|
|
||||||
* 'wait_for_signal' call.
|
|
||||||
*/
|
|
||||||
context->increment_signal_cnt(cnt);
|
|
||||||
|
|
||||||
if (!context->is_enqueued())
|
|
||||||
_signal_queue.enqueue(context);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user