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:
parent
6e993d31d4
commit
42397cb512
|
@ -132,6 +132,13 @@ namespace Genode {
|
||||||
*/
|
*/
|
||||||
void context(Signal_context_capability context);
|
void context(Signal_context_capability context);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return signal context
|
||||||
|
*/
|
||||||
|
Signal_context_capability context();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger signal submission to context
|
* Trigger signal submission to context
|
||||||
*
|
*
|
||||||
|
|
|
@ -78,6 +78,8 @@ Signal_transmitter::Signal_transmitter(Signal_context_capability context)
|
||||||
void Signal_transmitter::context(Signal_context_capability context) {
|
void Signal_transmitter::context(Signal_context_capability context) {
|
||||||
_context = context; }
|
_context = context; }
|
||||||
|
|
||||||
|
Signal_context_capability Signal_transmitter::context() { return _context; }
|
||||||
|
|
||||||
|
|
||||||
/*********************
|
/*********************
|
||||||
** Signal_receiver **
|
** Signal_receiver **
|
||||||
|
|
|
@ -260,6 +260,14 @@ class Packet_descriptor_transmitter
|
||||||
void register_rx_ready_cap(Genode::Signal_context_capability cap)
|
void register_rx_ready_cap(Genode::Signal_context_capability cap)
|
||||||
{
|
{
|
||||||
_rx_ready.context(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()
|
bool ready_for_tx()
|
||||||
|
@ -341,6 +349,14 @@ class Packet_descriptor_receiver
|
||||||
void register_tx_ready_cap(Genode::Signal_context_capability cap)
|
void register_tx_ready_cap(Genode::Signal_context_capability cap)
|
||||||
{
|
{
|
||||||
_tx_ready.context(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()
|
bool ready_for_rx()
|
||||||
|
|
Loading…
Reference in New Issue