Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ def autodoc_process_signature(
logger = getLogger("trio")
UNDOCUMENTED = {
"trio._subprocess.HasFileno.fileno",
"trio.lowlevel.ParkingLot.broken_by",
}


Expand Down
1 change: 1 addition & 0 deletions docs/source/reference-lowlevel.rst
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ Wait queue abstraction
.. autoclass:: ParkingLot
:members:
:undoc-members:
:exclude-members: broken_by

.. autoclass:: ParkingLotStatistics
:members:
Expand Down
2 changes: 2 additions & 0 deletions newsfragments/3221.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Document :attr:`trio.lowlevel.ParkingLot.broken_by`, including how repeated
calls to :meth:`~trio.lowlevel.ParkingLot.break_lot` record tasks.
8 changes: 8 additions & 0 deletions src/trio/_core/_parking_lot.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ class ParkingLot:
the number of parked tasks, and ``if parking_lot: ...`` to check whether
there are any parked tasks.

Attributes:
broken_by (list[trio.lowlevel.Task]):
Tasks recorded by calls to :meth:`break_lot`, in call order.
This list is empty until the lot is broken. Each call appends its
``task`` argument, or the current task if none is supplied, even
if the lot is already broken. The same task can therefore appear
more than once.

"""

# {task: None}, we just want a deque where we can quickly delete random
Expand Down
Loading