@@ -777,26 +777,28 @@ rnb_err_t RNBRemote::GetPacketPayload(std::string &return_packet) {
777
777
// DNBLogThreadedIf (LOG_RNB_MAX, "%8u RNBRemote::%s called",
778
778
// (uint32_t)m_comm.Timer().ElapsedMicroSeconds(true), __FUNCTION__);
779
779
780
- PThreadMutex::Locker locker (m_mutex);
781
- if (m_rx_packets.empty ()) {
782
- // Only reset the remote command available event if we have no more packets
783
- m_ctx.Events ().ResetEvents (RNBContext::event_read_packet_available);
784
- // DNBLogThreadedIf (LOG_RNB_MAX, "%8u RNBRemote::%s error: no packets
785
- // available...", (uint32_t)m_comm.Timer().ElapsedMicroSeconds(true),
786
- // __FUNCTION__);
787
- return rnb_err;
788
- }
780
+ {
781
+ PThreadMutex::Locker locker (m_mutex);
782
+ if (m_rx_packets.empty ()) {
783
+ // Only reset the remote command available event if we have no more
784
+ // packets
785
+ m_ctx.Events ().ResetEvents (RNBContext::event_read_packet_available);
786
+ // DNBLogThreadedIf (LOG_RNB_MAX, "%8u RNBRemote::%s error: no packets
787
+ // available...", (uint32_t)m_comm.Timer().ElapsedMicroSeconds(true),
788
+ // __FUNCTION__);
789
+ return rnb_err;
790
+ }
789
791
790
- // DNBLogThreadedIf (LOG_RNB_MAX, "%8u RNBRemote::%s has %u queued packets",
791
- // (uint32_t)m_comm.Timer().ElapsedMicroSeconds(true), __FUNCTION__,
792
- // m_rx_packets.size());
793
- return_packet.swap (m_rx_packets.front ());
794
- m_rx_packets.pop_front ();
795
- locker. Reset (); // Release our lock on the mutex
796
-
797
- if (m_rx_packets. empty ()) {
798
- // Reset the remote command available event if we have no more packets
799
- m_ctx. Events (). ResetEvents (RNBContext::event_read_packet_available);
792
+ // DNBLogThreadedIf (LOG_RNB_MAX, "%8u RNBRemote::%s has %u queued packets",
793
+ // (uint32_t)m_comm.Timer().ElapsedMicroSeconds(true), __FUNCTION__,
794
+ // m_rx_packets.size());
795
+ return_packet.swap (m_rx_packets.front ());
796
+ m_rx_packets.pop_front ();
797
+
798
+ if (m_rx_packets. empty ()) {
799
+ // Reset the remote command available event if we have no more packets
800
+ m_ctx. Events (). ResetEvents (RNBContext::event_read_packet_available);
801
+ }
800
802
}
801
803
802
804
// DNBLogThreadedIf (LOG_RNB_MEDIUM, "%8u RNBRemote::%s: '%s'",
0 commit comments