From c43bd472ace623dcccf2d15a09f9bf827370cf76 Mon Sep 17 00:00:00 2001 From: Christian Helmuth Date: Tue, 15 Dec 2015 14:42:47 +0100 Subject: [PATCH] packet_stream: peek_packet() should be const This also fixes the wrong return type. Fixes #1800 --- repos/os/include/os/packet_stream.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/repos/os/include/os/packet_stream.h b/repos/os/include/os/packet_stream.h index 53d56bc6c8..dea721dc19 100644 --- a/repos/os/include/os/packet_stream.h +++ b/repos/os/include/os/packet_stream.h @@ -215,7 +215,7 @@ class Genode::Packet_descriptor_queue /** * Return current packet descriptor */ - PACKET_DESCRIPTOR peek() + PACKET_DESCRIPTOR peek() const { return _queue[_tail%QUEUE_SIZE]; } @@ -355,10 +355,10 @@ class Genode::Packet_descriptor_receiver Genode::Signal_context_capability _rx_ready_cap; /* facility to send ready-to-transmit signals */ - Genode::Signal_transmitter _tx_ready; + Genode::Signal_transmitter _tx_ready; - Genode::Lock _rx_queue_lock; - RX_QUEUE *_rx_queue; + Genode::Lock mutable _rx_queue_lock; + RX_QUEUE *_rx_queue; public: @@ -413,7 +413,7 @@ class Genode::Packet_descriptor_receiver _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); 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. */ - Packet_descriptor peek_packet() + Packet_descriptor peek_packet() const { return _submit_receiver.rx_peek(); }