timeout-decorator icon indicating copy to clipboard operation
timeout-decorator copied to clipboard

`use_signals` does not work with a `threading.Lock`

Open mattdee123 opened this issue 5 years ago • 1 comments

The following code hangs indefinitely on my laptop (OSX).

import threading
import timeout_decorator

@timeout_decorator.timeout(1)
def main():
    l = threading.Lock()
    l.acquire()
    l.acquire()

if __name__ == '__main__':
    main()

With use_signals, it does not fail. Ideally, there's a way to fix this, but short of that, it'd be great to have this limitation more prominent in the docs.

mattdee123 avatar Jul 21 '20 21:07 mattdee123

I tested with https://github.com/bitranox/wrapt_timeout_decorator - we dont have this problem.

bitranox avatar Apr 26 '22 21:04 bitranox