@@ -656,20 +656,21 @@ the call as often as necessary.
656656
657657 .. versionadded :: 3.2
658658
659- .. method :: notify()
659+ .. method :: notify(n=1 )
660660
661- Wake up a thread waiting on this condition, if any. If the calling thread
662- has not acquired the lock when this method is called, a
661+ By default, wake up one thread waiting on this condition, if any. If the
662+ calling thread has not acquired the lock when this method is called, a
663663 :exc: `RuntimeError ` is raised.
664664
665- This method wakes up one of the threads waiting for the condition
666- variable, if any are waiting ; it is a no-op if no threads are waiting.
665+ This method wakes up at most * n * of the threads waiting for the condition
666+ variable; it is a no-op if no threads are waiting.
667667
668- The current implementation wakes up exactly one thread, if any are
669- waiting. However, it's not safe to rely on this behavior. A future,
670- optimized implementation may occasionally wake up more than one thread.
668+ The current implementation wakes up exactly *n * threads, if at least *n *
669+ threads are waiting. However, it's not safe to rely on this behavior.
670+ A future, optimized implementation may occasionally wake up more than
671+ *n * threads.
671672
672- Note: the awakened thread does not actually return from its :meth: `wait `
673+ Note: an awakened thread does not actually return from its :meth: `wait `
673674 call until it can reacquire the lock. Since :meth: `notify ` does not
674675 release the lock, its caller should.
675676
0 commit comments