Lines Matching defs:pAioMgr

191 static void pdmacFileAioMgrWakeup(PPDMACEPFILEMGR pAioMgr)
193 bool fWokenUp = ASMAtomicXchgBool(&pAioMgr->fWokenUp, true);
196 bool fWaitingEventSem = ASMAtomicReadBool(&pAioMgr->fWaitingEventSem);
199 int rc = RTSemEventSignal(pAioMgr->EventSem);
205 static int pdmacFileAioMgrWaitForBlockingEvent(PPDMACEPFILEMGR pAioMgr, PDMACEPFILEAIOMGRBLOCKINGEVENT enmEvent)
207 ASMAtomicWriteU32((volatile uint32_t *)&pAioMgr->enmBlockingEvent, enmEvent);
208 Assert(!pAioMgr->fBlockingEventPending);
209 ASMAtomicXchgBool(&pAioMgr->fBlockingEventPending, true);
212 pdmacFileAioMgrWakeup(pAioMgr);
215 int rc = RTSemEventWait(pAioMgr->EventSemBlock, RT_INDEFINITE_WAIT);
218 ASMAtomicXchgBool(&pAioMgr->fBlockingEventPending, false);
219 ASMAtomicWriteU32((volatile uint32_t *)&pAioMgr->enmBlockingEvent, PDMACEPFILEAIOMGRBLOCKINGEVENT_INVALID);
224 int pdmacFileAioMgrAddEndpoint(PPDMACEPFILEMGR pAioMgr, PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint)
226 LogFlowFunc(("pAioMgr=%#p pEndpoint=%#p{%s}\n", pAioMgr, pEndpoint, pEndpoint->Core.pszUri));
229 ASMAtomicWritePtr(&pEndpoint->pAioMgr, pAioMgr);
231 int rc = RTCritSectEnter(&pAioMgr->CritSectBlockingEvent);
234 ASMAtomicWritePtr(&pAioMgr->BlockingEventData.AddEndpoint.pEndpoint, pEndpoint);
235 rc = pdmacFileAioMgrWaitForBlockingEvent(pAioMgr, PDMACEPFILEAIOMGRBLOCKINGEVENT_ADD_ENDPOINT);
236 ASMAtomicWriteNullPtr(&pAioMgr->BlockingEventData.AddEndpoint.pEndpoint);
238 RTCritSectLeave(&pAioMgr->CritSectBlockingEvent);
244 static int pdmacFileAioMgrRemoveEndpoint(PPDMACEPFILEMGR pAioMgr, PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint)
246 int rc = RTCritSectEnter(&pAioMgr->CritSectBlockingEvent);
249 ASMAtomicWritePtr(&pAioMgr->BlockingEventData.RemoveEndpoint.pEndpoint, pEndpoint);
250 rc = pdmacFileAioMgrWaitForBlockingEvent(pAioMgr, PDMACEPFILEAIOMGRBLOCKINGEVENT_REMOVE_ENDPOINT);
251 ASMAtomicWriteNullPtr(&pAioMgr->BlockingEventData.RemoveEndpoint.pEndpoint);
253 RTCritSectLeave(&pAioMgr->CritSectBlockingEvent);
259 static int pdmacFileAioMgrCloseEndpoint(PPDMACEPFILEMGR pAioMgr, PPDMASYNCCOMPLETIONENDPOINTFILE pEndpoint)
261 int rc = RTCritSectEnter(&pAioMgr->CritSectBlockingEvent);
264 ASMAtomicWritePtr(&pAioMgr->BlockingEventData.CloseEndpoint.pEndpoint, pEndpoint);
265 rc = pdmacFileAioMgrWaitForBlockingEvent(pAioMgr, PDMACEPFILEAIOMGRBLOCKINGEVENT_CLOSE_ENDPOINT);
266 ASMAtomicWriteNullPtr(&pAioMgr->BlockingEventData.CloseEndpoint.pEndpoint);
268 RTCritSectLeave(&pAioMgr->CritSectBlockingEvent);
273 static int pdmacFileAioMgrShutdown(PPDMACEPFILEMGR pAioMgr)
275 int rc = RTCritSectEnter(&pAioMgr->CritSectBlockingEvent);
278 rc = pdmacFileAioMgrWaitForBlockingEvent(pAioMgr, PDMACEPFILEAIOMGRBLOCKINGEVENT_SHUTDOWN);
280 RTCritSectLeave(&pAioMgr->CritSectBlockingEvent);
294 pdmacFileAioMgrWakeup(ASMAtomicReadPtrT(&pEndpoint->pAioMgr, PPDMACEPFILEMGR));
509 * @param pAioMgr The async I/O manager to destroy.
511 static void pdmacFileAioMgrDestroy(PPDMASYNCCOMPLETIONEPCLASSFILE pEpClassFile, PPDMACEPFILEMGR pAioMgr)
513 int rc = pdmacFileAioMgrShutdown(pAioMgr);
520 PPDMACEPFILEMGR pPrev = pAioMgr->pPrev;
521 PPDMACEPFILEMGR pNext = pAioMgr->pNext;
536 RTCritSectDelete(&pAioMgr->CritSectBlockingEvent);
537 RTSemEventDestroy(pAioMgr->EventSem);
538 if (pAioMgr->enmMgrType != PDMACEPFILEMGRTYPE_SIMPLE)
539 pdmacFileAioMgrNormalDestroy(pAioMgr);
541 MMR3HeapFree(pAioMgr);
1015 PPDMACEPFILEMGR pAioMgr = NULL;
1033 rc = pdmacFileAioMgrCreate(pEpClassFile, &pAioMgr, PDMACEPFILEMGRTYPE_SIMPLE);
1037 pAioMgr = pEpClassFile->pAioMgrHead;
1040 while (pAioMgr)
1042 if (pAioMgr->enmMgrType == enmMgrType)
1044 pAioMgr = pAioMgr->pNext;
1047 if (!pAioMgr)
1048 rc = pdmacFileAioMgrCreate(pEpClassFile, &pAioMgr, enmMgrType);
1061 rc = pdmacFileAioMgrAddEndpoint(pAioMgr, pEpFile);
1130 int rc = pdmacFileAioMgrCloseEndpoint(pEpFile->pAioMgr, pEpFile);
1137 if (pEpFile->pAioMgr->enmMgrType == PDMACEPFILEMGRTYPE_SIMPLE)
1138 pdmacFileAioMgrDestroy(pEpClassFile, pEpFile->pAioMgr);