Fennel: IoCompletionPortScheduler Class Reference (original) (raw)
Initiates a request, the details of which must already have been defined by the caller.
When the request completes, this scheduler will call notifyTransferCompletion on each binding associated with the request, and also break up the binding list. The bindings must not be altered by the caller until this notification is received. However, the request parameter itself need not live beyond this call.
Care must be taken to ensure that the schedule/notify sequences cannot deadlock. For example, the caller of schedule may hold a lock on a binding, and the implementation of schedule may acquire a scheduler lock internally. The notification callback may also need to take a lock on the binding. Thus, it is important that no scheduler lock be held while notifyTransferCompletion is called.
Parameters:
| request | parameters for the request to be scheduled |
|---|
Returns:
true if the request was successfully scheduled without any retries
Implements DeviceAccessScheduler.
Definition at line 76 of file IoCompletionPortScheduler.cpp.
References RandomAccessRequest::bindingList, RandomAccessRequest::cbOffset, RandomAccessRequest::cbTransfer, IntrusiveListMutator< T, DerivedListNode >::detach(), RandomAccessRequestBinding::getBuffer(), RandomAccessRequestBinding::getBufferSize(), RandomAccessDevice::getHandle(), isStarted(), RandomAccessRequestBinding::notifyTransferCompletion(), RandomAccessRequest::pDevice, RandomAccessRequest::READ, and RandomAccessRequest::type.