summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2019-08-29 08:45:19 (GMT)
committerGitHub <noreply@github.com>2019-08-29 08:45:19 (GMT)
commit35f6301d68bdb0517be284421782d64407dfe72c (patch)
tree2b25b22aa2800545bdcac6bbfe9ab36472e6542a /Doc
parent0dac68f1e593c11612ed54af9edb865d398f3b05 (diff)
downloadcpython-35f6301d68bdb0517be284421782d64407dfe72c.zip
cpython-35f6301d68bdb0517be284421782d64407dfe72c.tar.gz
cpython-35f6301d68bdb0517be284421782d64407dfe72c.tar.bz2
bpo-10978: Semaphores can release multiple threads at a time (GH-15588)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/threading.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 7de12fb..0489421 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -802,11 +802,14 @@ Semaphores also support the :ref:`context management protocol <with-locks>`.
.. versionchanged:: 3.2
The *timeout* parameter is new.
- .. method:: release()
+ .. method:: release(n=1)
+
+ Release a semaphore, incrementing the internal counter by *n*. When it
+ was zero on entry and other threads are waiting for it to become larger
+ than zero again, wake up *n* of those threads.
- Release a semaphore, incrementing the internal counter by one. When it
- was zero on entry and another thread is waiting for it to become larger
- than zero again, wake up that thread.
+ .. versionchanged:: 3.9
+ Added the *n* parameter to release multiple waiting threads at once.
.. class:: BoundedSemaphore(value=1)