aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorCiro Nishiguchi <ciro.nishiguchi@ni.com>2020-10-19 20:43:29 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-10-20 14:58:52 -0500
commitd5a1259526ad4b729b19bc885ddfc09228087788 (patch)
tree00b2d21f0a81193521140728e53b92e1668574d0 /host
parent7b71a9542c28575b61f01e58209a48aefaa143c9 (diff)
downloaduhd-d5a1259526ad4b729b19bc885ddfc09228087788.tar.gz
uhd-d5a1259526ad4b729b19bc885ddfc09228087788.tar.bz2
uhd-d5a1259526ad4b729b19bc885ddfc09228087788.zip
fixup! rfnoc: Fix thread unsafe accesses in ctrlport
Diffstat (limited to 'host')
-rw-r--r--host/lib/rfnoc/ctrlport_endpoint.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/host/lib/rfnoc/ctrlport_endpoint.cpp b/host/lib/rfnoc/ctrlport_endpoint.cpp
index de5fa00b7..68a2dddf4 100644
--- a/host/lib/rfnoc/ctrlport_endpoint.cpp
+++ b/host/lib/rfnoc/ctrlport_endpoint.cpp
@@ -389,14 +389,13 @@ private:
// If we can fit the current request in the queue then we can proceed
return (_buff_occupied + pyld_size)
<= (_buff_capacity
- - (ASYNC_MESSAGE_SIZE * _max_outstanding_async_msgs));
+ - (ASYNC_MESSAGE_SIZE * _max_outstanding_async_msgs));
};
if (!buff_not_full()) {
// If there is a timed command in the queue, use the
// MASSIVE_TIMEOUT instead
- auto timeout_time = start_timeout(check_timed_in_queue() ?
- MASSIVE_TIMEOUT :
- _policy.timeout);
+ auto timeout_time =
+ start_timeout(check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout);
if (not _buff_free_cond.wait_until(lock, timeout_time, buff_not_full)) {
throw uhd::op_timeout(
@@ -423,9 +422,8 @@ private:
if (!resp_ready()) {
// If we're waiting for a timed command or if we have a
// command in the queue, use the MASSIVE_TIMEOUT instead
- auto timeout_time = start_timeout(check_timed_in_queue() ?
- MASSIVE_TIMEOUT :
- _policy.timeout);
+ auto timeout_time = start_timeout(
+ check_timed_in_queue() ? MASSIVE_TIMEOUT : _policy.timeout);
if (not _resp_ready_cond.wait_until(lock, timeout_time, resp_ready)) {
throw uhd::op_timeout("Control operation timed out waiting for ACK");