diff --git a/README.md b/README.md index d366d5b..a934f64 100644 --- a/README.md +++ b/README.md @@ -1981,13 +1981,14 @@ from threading import Thread, RLock thread = Thread(target=, args=(, )) thread.start() ... -thread.join() + = thread.is_alive() # Checks if thread has finished executing. +thread.join() # Waits for thread to finish. ``` ### Lock ```python lock = RLock() -lock.acquire() +lock.acquire() # Waits for lock to be available. ... lock.release() ``` @@ -2005,7 +2006,7 @@ from concurrent.futures import ThreadPoolExecutor with ThreadPoolExecutor(max_workers=None) as executor: = executor.map(lambda x: x + 1, range(3)) # (1, 2, 3) = executor.map(lambda x, y: x + y, 'abc', '123') # ('a1', 'b2', 'c3') - = executor.submit(, , ...) + = executor.submit( [, , ...]) ``` ```python diff --git a/index.html b/index.html index 50d3f28..37b90e5 100644 --- a/index.html +++ b/index.html @@ -1749,11 +1749,12 @@ db = connector.connect(host=<str>, user=<str>, password=<str>,

Thread

thread = Thread(target=<function>, args=(<first_arg>, ))
 thread.start()
 ...
-thread.join()
+<bool> = thread.is_alive()   # Checks if thread has finished executing.
+thread.join()                # Waits for thread to finish.
 

Lock

lock = RLock()
-lock.acquire()
+lock.acquire()               # Waits for lock to be available.
 ...
 lock.release()
 
@@ -1767,7 +1768,7 @@ lock.release() with ThreadPoolExecutor(max_workers=None) as executor: <iter> = executor.map(lambda x: x + 1, range(3)) # (1, 2, 3) <iter> = executor.map(lambda x, y: x + y, 'abc', '123') # ('a1', 'b2', 'c3') - <Future> = executor.submit(<function>, <arg_1>, ...) + <Future> = executor.submit(<function> [, <arg_1>, ...])
<bool> = <Future>.done()     # Checks if thread has finished executing.