summaryrefslogtreecommitdiff
path: root/python/test/Ice/operations/OnewaysAMI.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2016-12-09 15:18:08 -0800
committerMark Spruiell <mes@zeroc.com>2016-12-09 15:18:08 -0800
commit3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5 (patch)
treea8edbf5d1043527cc50880b34ee83458ed7e4855 /python/test/Ice/operations/OnewaysAMI.py
parentMerge remote-tracking branch 'origin/3.6' (diff)
downloadice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.bz2
ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.tar.xz
ice-3b7e9f99b61538e0bbd6f07deeb7f7cb12013ed5.zip
ICE-7138 - new Python AMI mapping based on futures and modified AMD mapping
Diffstat (limited to 'python/test/Ice/operations/OnewaysAMI.py')
-rw-r--r--python/test/Ice/operations/OnewaysAMI.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/python/test/Ice/operations/OnewaysAMI.py b/python/test/Ice/operations/OnewaysAMI.py
index e0e1fac0cca..4c08b60f52f 100644
--- a/python/test/Ice/operations/OnewaysAMI.py
+++ b/python/test/Ice/operations/OnewaysAMI.py
@@ -19,19 +19,15 @@ class CallbackBase:
self._cond = threading.Condition()
def check(self):
- self._cond.acquire()
- try:
+ with self._cond:
while not self._called:
self._cond.wait()
self._called = False
- finally:
- self._cond.release()
def called(self):
- self._cond.acquire()
- self._called = True
- self._cond.notify()
- self._cond.release()
+ with self._cond:
+ self._called = True
+ self._cond.notify()
class Callback(CallbackBase):
def sent(self, sentSynchronously):