Make smart futures avoid polling.
[python_utils.git] / thread_utils.py
index af6e0e1abe840946a8754e426ca93bd653545ca5..0130cdc510547196d418d6699d1b46b84a6ddf7c 100644 (file)
@@ -6,6 +6,9 @@ import os
 import threading
 from typing import Callable, Optional, Tuple
 
+# This module is commonly used by others in here and should avoid
+# taking any unnecessary dependencies back on them.
+
 logger = logging.getLogger(__name__)
 
 
@@ -17,6 +20,9 @@ def current_thread_id() -> str:
 
 
 def is_current_thread_main_thread() -> bool:
+    """Returns True is the current (calling) thread is the process' main
+    thread and False otherwise.
+    """
     return threading.current_thread() is threading.main_thread()