Skip to content

Commit

Permalink
[rospy] made get_published_topics threadsafe (ros#958)
Browse files Browse the repository at this point in the history
* [rospy] made get_published_topics threadsafe
  • Loading branch information
Jannik Abbenseth authored and ggallagher01 committed Jan 26, 2017
1 parent 14f4e09 commit 3596b17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions clients/rospy/src/rospy/msproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ def __init__(self, uri):
self._lock = Lock()

def __getattr__(self, key): #forward api calls to target
with self._lock:
f = getattr(self.target, key)
if key in _master_arg_remap:
remappings = _master_arg_remap[key]
else:
Expand All @@ -103,7 +101,9 @@ def wrappedF(*args, **kwds):
i = i + 1 #callerId does not count
#print "Remap %s => %s"%(args[i], rospy.names.resolve_name(args[i]))
args[i] = rospy.names.resolve_name(args[i])
return f(*args, **kwds)
with self._lock:
f = getattr(self.target, key)
return f(*args, **kwds)
return wrappedF

def __getitem__(self, key):
Expand Down

0 comments on commit 3596b17

Please sign in to comment.