From 971641a3b4c572146619ac6ef3ba8c89e3967048 Mon Sep 17 00:00:00 2001 From: Javier Date: Sun, 27 Nov 2022 00:55:21 +0100 Subject: updating to virtualbox7.0 API --- Adlib.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Adlib.cpp') diff --git a/Adlib.cpp b/Adlib.cpp index c2045c6..2bdd62e 100644 --- a/Adlib.cpp +++ b/Adlib.cpp @@ -211,7 +211,8 @@ static DECLCALLBACK(int) adlibRenderThread(RTTHREAD ThreadSelf, void *pvUser) && ASMAtomicReadU64(&pThis->tmLastWrite) + ADLIB_RENDER_SUSPEND_TIMEOUT >= RTTimeSystemMilliTS()) { Log9(("rendering %lld frames\n", buf_frames)); - PDMDevHlpCritSectEnter(pDevIns, &pThis->critSect, VERR_SEM_BUSY); + rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->critSect, VERR_SEM_BUSY); + PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->critSect, rc); OPL3_GenerateStream(&pThis->opl, buf, buf_frames); PDMDevHlpCritSectLeave(pDevIns, &pThis->critSect); @@ -406,7 +407,8 @@ static void adlibWriteRegister(PPDMDEVINS pDevIns, uint16_t reg, uint8_t value) break; default: - PDMDevHlpCritSectEnter(pDevIns, &pThis->critSect, VERR_SEM_BUSY); + int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->critSect, VERR_SEM_BUSY); + PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->critSect, rc); OPL3_WriteRegBuffered(&pThis->opl, reg, value); PDMDevHlpCritSectLeave(pDevIns, &pThis->critSect); break; @@ -544,9 +546,11 @@ static DECLCALLBACK(void) adlibR3Reset(PPDMDEVINS pDevIns) { PADLIBSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PADLIBSTATE); - PDMDevHlpCritSectEnter(pDevIns, &pThis->critSect, VERR_SEM_BUSY); + int rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->critSect, VERR_SEM_BUSY); + PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->critSect, rc); OPL3_Reset(&pThis->opl, pThis->uSampleRate); PDMDevHlpCritSectLeave(pDevIns, &pThis->critSect); + pThis->oplReg = 0; pThis->timer1Enable = false; pThis->timer1Expire = 0; -- cgit v1.2.3