summaryrefslogtreecommitdiff
path: root/decorator_utils.py
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2022-08-15 09:20:20 -0700
committerScott Gasch <[email protected]>2022-08-15 09:20:20 -0700
commit6ca1a7b51513673a7ae10ee38057e83aaee4c409 (patch)
tree9ab6147d8e6fb53cb7602fe173c13a75c97f5f05 /decorator_utils.py
parent54b5493516c71cd8f5ac65a698c73c2adc629838 (diff)
Fix a threading related bug in tplink_utils.
Diffstat (limited to 'decorator_utils.py')
-rw-r--r--decorator_utils.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/decorator_utils.py b/decorator_utils.py
index 438d7f9..4615fec 100644
--- a/decorator_utils.py
+++ b/decorator_utils.py
@@ -647,6 +647,13 @@ def timeout(
main thread). When not using signals, timeout granularity will be
rounded to the nearest 0.1s.
+ Beware that an @timeout on a function inside a module will be
+ evaluated at module load time and not when the wrapped function is
+ invoked. This can lead to problems when relying on the automatic
+ main thread detection code (use_signals=None, the default) since
+ the import probably happens on the main thread and the invocation
+ can happen on a different thread (which can't use signals).
+
Raises an exception when/if the timeout is reached.
It is illegal to pass anything other than a function as the first