Lines Matching defs:pIoBackend
84 * @param pIoBackend The backend to poke.
86 static int vdIoBackendMemThreadPoke(PVDIOBACKENDMEM pIoBackend)
88 return RTSemEventSignal(pIoBackend->EventSem);
94 PVDIOBACKENDMEM pIoBackend = NULL;
96 pIoBackend = (PVDIOBACKENDMEM)RTMemAllocZ(sizeof(VDIOBACKENDMEM));
97 if (pIoBackend)
99 rc = RTCircBufCreate(&pIoBackend->pRequestRing, VDMEMIOBACKEND_REQS * sizeof(PVDIOBACKENDREQ));
102 pIoBackend->cReqsRing = VDMEMIOBACKEND_REQS * sizeof(VDIOBACKENDREQ);
103 pIoBackend->fRunning = true;
105 rc = RTSemEventCreate(&pIoBackend->EventSem);
108 rc = RTThreadCreate(&pIoBackend->hThreadIo, vdIoBackendMemThread, pIoBackend, 0, RTTHREADTYPE_IO,
112 *ppIoBackend = pIoBackend;
117 RTSemEventDestroy(pIoBackend->EventSem);
120 RTCircBufDestroy(pIoBackend->pRequestRing);
123 RTMemFree(pIoBackend);
131 int VDIoBackendMemDestroy(PVDIOBACKENDMEM pIoBackend)
133 ASMAtomicXchgBool(&pIoBackend->fRunning, false);
134 vdIoBackendMemThreadPoke(pIoBackend);
136 RTThreadWait(pIoBackend->hThreadIo, RT_INDEFINITE_WAIT, NULL);
137 RTSemEventDestroy(pIoBackend->EventSem);
138 RTCircBufDestroy(pIoBackend->pRequestRing);
139 RTMemFree(pIoBackend);
144 int VDIoBackendMemTransfer(PVDIOBACKENDMEM pIoBackend, PVDMEMDISK pMemDisk,
162 RTCircBufAcquireWriteBlock(pIoBackend->pRequestRing, sizeof(PVDIOBACKENDREQ), (void **)&ppReq, &cbData);
183 RTCircBufReleaseWriteBlock(pIoBackend->pRequestRing, sizeof(PVDIOBACKENDREQ));
184 uint32_t cReqsWaiting = ASMAtomicIncU32(&pIoBackend->cReqsWaiting);
186 vdIoBackendMemThreadPoke(pIoBackend);
201 PVDIOBACKENDMEM pIoBackend = (PVDIOBACKENDMEM)pvUser;
203 while (pIoBackend->fRunning)
205 int rc = RTSemEventWait(pIoBackend->EventSem, RT_INDEFINITE_WAIT);
206 if (RT_FAILURE(rc) || !pIoBackend->fRunning)
212 uint32_t cReqsWaiting = ASMAtomicXchgU32(&pIoBackend->cReqsWaiting, 0);
219 RTCircBufAcquireReadBlock(pIoBackend->pRequestRing, sizeof(PVDIOBACKENDREQ), (void **)&ppReq, &cbData);
221 RTCircBufReleaseReadBlock(pIoBackend->pRequestRing, cbData);