diff options
Diffstat (limited to 'python/test/Ice/operations/BatchOnewaysAMI.py')
-rw-r--r-- | python/test/Ice/operations/BatchOnewaysAMI.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/python/test/Ice/operations/BatchOnewaysAMI.py b/python/test/Ice/operations/BatchOnewaysAMI.py index 5515185d572..cd53ee94470 100644 --- a/python/test/Ice/operations/BatchOnewaysAMI.py +++ b/python/test/Ice/operations/BatchOnewaysAMI.py @@ -19,19 +19,15 @@ class Callback: 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() def batchOneways(p): |