From 91677a9dcb6bc508aa111f3be73d1d8540406d7c Mon Sep 17 00:00:00 2001 From: faluco Date: Mon, 25 Oct 2021 13:17:21 +0200 Subject: [PATCH] Fix data race in sync::state, the stop() did not acquire the required lock. --- srsue/hdr/phy/scell/scell_sync.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/srsue/hdr/phy/scell/scell_sync.h b/srsue/hdr/phy/scell/scell_sync.h index 59f677c86..0f80d0cb4 100644 --- a/srsue/hdr/phy/scell/scell_sync.h +++ b/srsue/hdr/phy/scell/scell_sync.h @@ -199,7 +199,11 @@ public: /** * Resets the class, goes back into IDLE mode */ - void stop() { state = STATE_IDLE; } + void stop() + { + std::unique_lock lock(mutex); + state = STATE_IDLE; + } /** * Runs internal FSM, performing Synchronization operations on the provided buffer. It expects data per subframe