summaryrefslogtreecommitdiff
path: root/python/test/Ice/ami/TestI.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/test/Ice/ami/TestI.py')
-rw-r--r--python/test/Ice/ami/TestI.py15
1 files changed, 3 insertions, 12 deletions
diff --git a/python/test/Ice/ami/TestI.py b/python/test/Ice/ami/TestI.py
index 53ee490ff71..f37bd47f806 100644
--- a/python/test/Ice/ami/TestI.py
+++ b/python/test/Ice/ami/TestI.py
@@ -27,30 +27,21 @@ class TestIntfI(Test.TestIntf):
pass
def opBatch(self, current=None):
- self._cond.acquire()
- try:
+ with self._cond:
self._batchCount += 1
self._cond.notify()
- finally:
- self._cond.release()
def opBatchCount(self, current=None):
- self._cond.acquire()
- try:
+ with self._cond:
return self._batchCount
- finally:
- self._cond.release()
def waitForBatch(self, count, current=None):
- self._cond.acquire()
- try:
+ with self._cond:
while self._batchCount < count:
self._cond.wait(5)
result = count == self._batchCount
self._batchCount = 0
return result
- finally:
- self._cond.release()
def close(self, force, current=None):
current.con.close(force)