Commit 68b0ec39 authored by ORD's avatar ORD

Merge pull request #88 from huazh/deadlock

fix deadlock
parents 21713f43 8fd23e04
...@@ -395,13 +395,17 @@ class AddressSpace(object): ...@@ -395,13 +395,17 @@ class AddressSpace(object):
attval = node.attributes[attr] attval = node.attributes[attr]
old = attval.value old = attval.value
attval.value = value attval.value = value
cbs = []
if old.Value != value.Value: # only send call callback when a value change has happend if old.Value != value.Value: # only send call callback when a value change has happend
for k, v in attval.datachange_callbacks.items(): cbs = list(attval.datachange_callbacks.items())
try:
v(k, value) for k, v in cbs:
except Exception as ex: try:
self.logger.exception("Error calling datachange callback %s, %s, %s", k, v, ex) v(k, value)
return ua.StatusCode() except Exception as ex:
self.logger.exception("Error calling datachange callback %s, %s, %s", k, v, ex)
return ua.StatusCode()
def add_datachange_callback(self, nodeid, attr, callback): def add_datachange_callback(self, nodeid, attr, callback):
with self._lock: with self._lock:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment