From 93b7f373097f3b1563ff327ffa163846b8da0987 Mon Sep 17 00:00:00 2001 From: Tom Tsou Date: Mon, 15 Dec 2014 20:23:33 -0800 Subject: b210: Lock dual-channel tuning access Frequency tuning is a multi-step process with RF and DDC/DUC protoimns that can be corrupted if both channels attempt to tune at the same time. Signed-off-by: Tom Tsou --- Transceiver52M/UHDDevice.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Transceiver52M/UHDDevice.cpp b/Transceiver52M/UHDDevice.cpp index d81fdc3..130a915 100644 --- a/Transceiver52M/UHDDevice.cpp +++ b/Transceiver52M/UHDDevice.cpp @@ -380,6 +380,7 @@ private: Thread *async_event_thrd; bool diversity; + Mutex tune_lock; }; void *async_event_loop(uhd_device *dev) @@ -1145,6 +1146,7 @@ bool uhd_device::setTxFreq(double wFreq, size_t chan) LOG(ALERT) << "Requested non-existent channel " << chan; return false; } + ScopedLock lock(tune_lock); return set_freq(wFreq, chan, true); } @@ -1155,6 +1157,7 @@ bool uhd_device::setRxFreq(double wFreq, size_t chan) LOG(ALERT) << "Requested non-existent channel " << chan; return false; } + ScopedLock lock(tune_lock); return set_freq(wFreq, chan, false); } -- cgit v1.2.3