pub struct Request {
next: AtomicPtr<Behavior>,
scheduled: AtomicBool,
target: Arc<dyn CownBase>,
}
Expand description
A request for a cown.
Fields§
§next: AtomicPtr<Behavior>
Pointer to the next scheduled behavior.
scheduled: AtomicBool
Is this request scheduled?
target: Arc<dyn CownBase>
The cown that this request wants to access.
This is an Arc
as the all exposed CownPtr
s may have been dropped while the behavior is
still scheduled.
Implementations§
Source§impl Request
impl Request
Sourceunsafe fn start_enqueue(&self, behavior: *const Behavior)
unsafe fn start_enqueue(&self, behavior: *const Behavior)
Start the first phase of the 2PL enqueue operation.
Enqueues self
onto the target
cown. Returns once all previous behaviors on this cown has
finished enqueueing on all of its required cowns. This ensures the 2PL protocol.
§SAFETY
behavior
must be a valid raw pointer to the behavior for self
, and this should be the
only enqueueing of this request and behavior.
Sourceunsafe fn finish_enqueue(&self)
unsafe fn finish_enqueue(&self)
Finish the second phase of the 2PL enqueue operation.
Sets the scheduled flag so that subsequent behaviors can continue the 2PL enqueue.
§Safety
All enqueues for smaller requests on this cown must have been completed.