diff --git a/repos/ports/src/virtualbox6/sup_sem.cc b/repos/ports/src/virtualbox6/sup_sem.cc index 16f93da618..dbbeae9aeb 100644 --- a/repos/ports/src/virtualbox6/sup_sem.cc +++ b/repos/ports/src/virtualbox6/sup_sem.cc @@ -81,28 +81,41 @@ int SUPSemEventMultiCreate(PSUPDRVSESSION pSession, { AssertPtrReturn(phEventMulti, VERR_INVALID_POINTER); - return RTSemEventMultiCreate((RTSEMEVENTMULTI*)phEventMulti); + return RTSemEventMultiCreate((RTSEMEVENTMULTI *)phEventMulti); } int SUPSemEventMultiClose(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti) { - return RTSemEventMultiDestroy(reinterpret_cast(hEventMulti)); + return RTSemEventMultiDestroy((RTSEMEVENTMULTI)hEventMulti); } int SUPSemEventMultiSignal(PSUPDRVSESSION pSession, - SUPSEMEVENTMULTI hEventMulti) STOP + SUPSEMEVENTMULTI hEventMulti) +{ + return RTSemEventMultiSignal((RTSEMEVENTMULTI)hEventMulti); +} int SUPSemEventMultiReset(PSUPDRVSESSION pSession, - SUPSEMEVENTMULTI hEventMulti) STOP + SUPSEMEVENTMULTI hEventMulti) +{ + return RTSemEventMultiReset((RTSEMEVENTMULTI)hEventMulti); +} int SUPSemEventMultiWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, - uint32_t cMillies) STOP + uint32_t cMillies) +{ + uint32_t fFlags = RTSEMWAIT_FLAGS_RELATIVE | RTSEMWAIT_FLAGS_MILLISECS | RTSEMWAIT_FLAGS_INTERRUPTIBLE; + if (cMillies == RT_INDEFINITE_WAIT) + fFlags |= RTSEMWAIT_FLAGS_INDEFINITE; + + return RTSemEventMultiWaitEx((RTSEMEVENTMULTI)hEventMulti, fFlags, cMillies); +} int SUPSemEventMultiWaitNsAbsIntr(PSUPDRVSESSION pSession, @@ -112,7 +125,10 @@ int SUPSemEventMultiWaitNsAbsIntr(PSUPDRVSESSION pSession, int SUPSemEventMultiWaitNsRelIntr(PSUPDRVSESSION pSession, SUPSEMEVENTMULTI hEventMulti, - uint64_t cNsTimeout) STOP + uint64_t cNsTimeout) +{ + return RTSemEventMultiWaitNoResume((RTSEMEVENTMULTI)hEventMulti, cNsTimeout/1'000'000); +} uint32_t SUPSemEventMultiGetResolution(PSUPDRVSESSION pSession)