mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-27 19:19:54 +00:00
fixed logic error in state machine
This commit is contained in:
parent
6e34b2cfdd
commit
11a6e6d2e0
1 changed files with 214 additions and 209 deletions
7
sleekxmpp/thirdparty/statemachine.py
vendored
7
sleekxmpp/thirdparty/statemachine.py
vendored
|
@ -84,7 +84,12 @@ class StateMachine(object):
|
||||||
|
|
||||||
|
|
||||||
start = time.time()
|
start = time.time()
|
||||||
while not self.__current_state in from_states or not self.lock.acquire(False):
|
while not self.lock.acquire(False):
|
||||||
|
time.sleep(.001)
|
||||||
|
if (start + wait - time.time()) <= 0.0:
|
||||||
|
return False
|
||||||
|
|
||||||
|
while not self.__current_state in from_states:
|
||||||
# detect timeout:
|
# detect timeout:
|
||||||
remainder = start + wait - time.time()
|
remainder = start + wait - time.time()
|
||||||
if remainder > 0: self.notifier.wait(remainder)
|
if remainder > 0: self.notifier.wait(remainder)
|
||||||
|
|
Loading…
Reference in a new issue