Skip to content

Commit d5bd517

Browse files
ollantapicnixz
authored andcommitted
Link to correct class methods in asyncio primitives docs (#127270)
1 parent fc0564b commit d5bd517

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Doc/library/asyncio-sync.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,13 +257,19 @@ Condition
257257
Once awakened, the Condition re-acquires its lock and this method
258258
returns ``True``.
259259

260+
Note that a task *may* return from this call spuriously,
261+
which is why the caller should always re-check the state
262+
and be prepared to :meth:`~Condition.wait` again. For this reason, you may
263+
prefer to use :meth:`~Condition.wait_for` instead.
264+
260265
.. coroutinemethod:: wait_for(predicate)
261266

262267
Wait until a predicate becomes *true*.
263268

264269
The predicate must be a callable which result will be
265-
interpreted as a boolean value. The final value is the
266-
return value.
270+
interpreted as a boolean value. The method will repeatedly
271+
:meth:`~Condition.wait` until the predicate evaluates to *true*.
272+
The final value is the return value.
267273

268274

269275
Semaphore
@@ -428,7 +434,7 @@ Barrier
428434
.. coroutinemethod:: abort()
429435

430436
Put the barrier into a broken state. This causes any active or future
431-
calls to :meth:`wait` to fail with the :class:`BrokenBarrierError`.
437+
calls to :meth:`~Barrier.wait` to fail with the :class:`BrokenBarrierError`.
432438
Use this for example if one of the tasks needs to abort, to avoid infinite
433439
waiting tasks.
434440

0 commit comments

Comments
 (0)