mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-03 12:34:12 +00:00
packet_stream: peek_packet() should be const
This also fixes the wrong return type. Fixes #1800
This commit is contained in:
parent
6deb80f66d
commit
c43bd472ac
@ -215,7 +215,7 @@ class Genode::Packet_descriptor_queue
|
|||||||
/**
|
/**
|
||||||
* Return current packet descriptor
|
* Return current packet descriptor
|
||||||
*/
|
*/
|
||||||
PACKET_DESCRIPTOR peek()
|
PACKET_DESCRIPTOR peek() const
|
||||||
{
|
{
|
||||||
return _queue[_tail%QUEUE_SIZE];
|
return _queue[_tail%QUEUE_SIZE];
|
||||||
}
|
}
|
||||||
@ -357,7 +357,7 @@ class Genode::Packet_descriptor_receiver
|
|||||||
/* facility to send ready-to-transmit signals */
|
/* facility to send ready-to-transmit signals */
|
||||||
Genode::Signal_transmitter _tx_ready;
|
Genode::Signal_transmitter _tx_ready;
|
||||||
|
|
||||||
Genode::Lock _rx_queue_lock;
|
Genode::Lock mutable _rx_queue_lock;
|
||||||
RX_QUEUE *_rx_queue;
|
RX_QUEUE *_rx_queue;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -413,7 +413,7 @@ class Genode::Packet_descriptor_receiver
|
|||||||
_tx_ready.submit();
|
_tx_ready.submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
typename RX_QUEUE::Packet_descriptor_queue rx_peek()
|
typename RX_QUEUE::Packet_descriptor rx_peek() const
|
||||||
{
|
{
|
||||||
Genode::Lock::Guard lock_guard(_rx_queue_lock);
|
Genode::Lock::Guard lock_guard(_rx_queue_lock);
|
||||||
return _rx_queue->peek();
|
return _rx_queue->peek();
|
||||||
@ -817,7 +817,7 @@ class Genode::Packet_stream_sink : private Packet_stream_base
|
|||||||
*
|
*
|
||||||
* If there is no packet, an invalid packet descriptor is returned.
|
* If there is no packet, an invalid packet descriptor is returned.
|
||||||
*/
|
*/
|
||||||
Packet_descriptor peek_packet()
|
Packet_descriptor peek_packet() const
|
||||||
{
|
{
|
||||||
return _submit_receiver.rx_peek();
|
return _submit_receiver.rx_peek();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user