From 9f3a10390cd305008b1359538854536c612c760c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 3 Oct 2019 03:37:31 +0200 Subject: [PATCH] Threading --- README.md | 1 + index.html | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 8db4919..d75c28f 100644 --- a/README.md +++ b/README.md @@ -2015,6 +2015,7 @@ thread.start() thread.join() # Waits for thread to finish. ``` * **Use `'kwargs='` to pass keyword arguments to the function.** +* **Use `'daemon=True'` or the program will not be able to exit while the thread is alive.** ### Lock ```python diff --git a/index.html b/index.html index d600ca4..25a4ab1 100644 --- a/index.html +++ b/index.html @@ -1777,6 +1777,7 @@ thread.join() # Waits for thre
  • Use 'kwargs=<dict>' to pass keyword arguments to the function.
  • +
  • Use 'daemon=True' or the program will not be able to exit while the thread is alive.

Lock

lock = RLock()
 lock.acquire()                       # Waits for lock to be available.