Skip to content

Commit 9922cca

Browse files
sdefauwettoreleandrotognoli
authored andcommitted
Concurent issue when connection timeout is not defined
1 parent 598a3dc commit 9922cca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

asterisk/ami/response.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,10 @@ def set_response(self, response):
7070
self._lock.release()
7171

7272
def get_response(self):
73+
self._lock.acquire()
7374
if self._response is not None:
75+
self._lock.release()
7476
return self._response
75-
self._lock.acquire()
7677
self._lock.wait(self._timeout)
7778
self._lock.release()
7879
return self._response

0 commit comments

Comments
 (0)