Skip to content

Commit

Permalink
Added missing lock
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrrx committed Sep 28, 2018
1 parent b71b622 commit 6597e46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clients/rospy/src/rospy/msproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def get_param_cached(self, key):
return rospy.impl.paramserver.get_param_server_cache().get(resolved_key)
except KeyError:
# first access, make call to parameter server
code, msg, value = self.target.subscribeParam(rospy.names.get_caller_id(), rospy.core.get_node_uri(), resolved_key)
with self._lock:
code, msg, value = self.target.subscribeParam(rospy.names.get_caller_id(), rospy.core.get_node_uri(), resolved_key)
if code != 1: #unwrap value with Python semantics
raise KeyError(key)
# set the value in the cache so that it's marked as subscribed
Expand Down

0 comments on commit 6597e46

Please sign in to comment.