diff options
Diffstat (limited to 'Doc/library/threading.rst')
-rw-r--r-- | Doc/library/threading.rst | 11 |
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) |