/// try-or-restart locking.
///
/// On contention, the Borrower releases all held locks and throws Dead,
-/// unwinding the entire planning pass. The Task infrastructure re-queues
-/// the work item on the conflicting Task's post-exec list.
+/// unwinding the entire planning pass. The Task is parked on the
+/// conflicting Exclusion's waiter list and rescheduled when that lock
+/// is released.
#include "bees-fwd.h"
/// clears it and releases all held locks.
///
/// Locking uses the Task/Exclusion rendezvous mechanism: when
-/// try_lock() fails, Exclusion appends the current Task to the
-/// winning Task's post-exec queue. When the winner finishes
-/// (i.e. its Borrower is destroyed and locks are released), the
-/// Task infrastructure automatically reschedules the losing Task.
-/// This is why Dead is safe as flow control — the planning pass
-/// will be retried once the contended resource is available.
+/// try_lock() fails, Exclusion parks the current Task on its
+/// waiter list. When the winner releases the lock (i.e. its
+/// Borrower is destroyed), the waiters are rescheduled. This is
+/// why Dead is safe as flow control — the planning pass will be
+/// retried once the contended resource is available.
class Borrower {
public:
/// Thrown when try_lock() fails due to contention.
/// the NamedPtr entry alive for the lifetime of the lock.
///
/// On failure (the Exclusion is held by another Task):
- /// 1. Exclusion::try_lock appends current Task to the
- /// winning Task's post-exec queue (rendezvous)
+ /// 1. Exclusion::try_lock parks the current Task on the
+ /// Exclusion's waiter list (rendezvous)
/// 2. m_dead is set to true
/// 3. All previously held locks are released
/// 4. Dead is thrown — caller unwinds the planning pass