os: avoid deadlock in packet stream (fix #1186)

Respectively resend a packet-stream-not-empty signal when a new signal handler
gets registered.
This commit is contained in:
Stefan Kalkowski 2014-06-18 15:04:30 +02:00 committed by Norman Feske
parent 6e993d31d4
commit 42397cb512
3 changed files with 25 additions and 0 deletions

View File

@ -132,6 +132,13 @@ namespace Genode {
*/
void context(Signal_context_capability context);
/**
* Return signal context
*/
Signal_context_capability context();
/**
* Trigger signal submission to context
*

View File

@ -78,6 +78,8 @@ Signal_transmitter::Signal_transmitter(Signal_context_capability context)
void Signal_transmitter::context(Signal_context_capability context) {
_context = context; }
Signal_context_capability Signal_transmitter::context() { return _context; }
/*********************
** Signal_receiver **

View File

@ -260,6 +260,14 @@ class Packet_descriptor_transmitter
void register_rx_ready_cap(Genode::Signal_context_capability cap)
{
_rx_ready.context(cap);
/*
* if a packet was already put into the queue
* before a signal handler was registered,
* a signal has to be send again
*/
if (!_tx_queue->empty())
_rx_ready.submit();
}
bool ready_for_tx()
@ -341,6 +349,14 @@ class Packet_descriptor_receiver
void register_tx_ready_cap(Genode::Signal_context_capability cap)
{
_tx_ready.context(cap);
/*
* if a packet was already put into the queue
* before a signal handler was registered,
* a signal has to be send again
*/
if (!_rx_queue->empty())
_tx_ready.submit();
}
bool ready_for_rx()