Decrease thread join time. Because it is a daemon thread it will get closed automatically on garbage collect, just need to initate a join at all.
This commit is contained in:
parent
5b93fe5d7c
commit
36b7d6f266
@ -80,7 +80,7 @@ def func_timeout(timeout, func, args=(), kwargs=None):
|
|||||||
isStopped = True
|
isStopped = True
|
||||||
stopException = FunctionTimedOut
|
stopException = FunctionTimedOut
|
||||||
thread._stopThread(stopException)
|
thread._stopThread(stopException)
|
||||||
thread.join(.1)
|
thread.join(min(.1, timeout / 50.0))
|
||||||
raise FunctionTimedOut('', timeout, func, args, kwargs)
|
raise FunctionTimedOut('', timeout, func, args, kwargs)
|
||||||
|
|
||||||
if exception:
|
if exception:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user