aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Braun <martin.braun@ettus.com>2017-07-12 16:50:31 -0700
committerMartin Braun <martin.braun@ettus.com>2017-12-22 15:04:00 -0800
commit8063697d68b935af6f981de666674f9621a56002 (patch)
treeb75dc512add794be7e449c48f3530b90a15175a9
parent7cd675833655829655176fb17c9c592aefb63c55 (diff)
downloaduhd-8063697d68b935af6f981de666674f9621a56002.tar.gz
uhd-8063697d68b935af6f981de666674f9621a56002.tar.bz2
uhd-8063697d68b935af6f981de666674f9621a56002.zip
mpm: Check rpc server has matching lock release/acquires
-rw-r--r--mpm/python/usrp_mpm/rpc_server.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mpm/python/usrp_mpm/rpc_server.py b/mpm/python/usrp_mpm/rpc_server.py
index 982e94c91..2f21edbee 100644
--- a/mpm/python/usrp_mpm/rpc_server.py
+++ b/mpm/python/usrp_mpm/rpc_server.py
@@ -159,6 +159,7 @@ class MPMServer(RPCServer):
self._state.lock.acquire()
if self._state.claim_status.value:
self.log.warning("Someone tried to claim this device again")
+ self._state.lock.release()
raise RuntimeError("Double-claim")
self.log.debug(
"Claiming from: %s, Session ID: %s",
@@ -204,8 +205,8 @@ class MPMServer(RPCServer):
if the device is claimed and the token doesn't match.
Or if the device is not claimed at all.
"""
- self._state.lock.acquire()
if self._state.claim_status.value:
+ self._state.lock.acquire()
if self._check_token_valid(token):
self._state.lock.release()
self.log.debug("reclaimed from: %s", self.client_host)