Lines Matching refs:pPP

49 #define RTSEMPP_VALIDATE_RETURN(pPP) \
51 AssertPtrReturn(pPP, VERR_INVALID_PARAMETER); \
52 AssertCompileSize(pPP->enmSpeaker, 4); \
53 enmSpeaker = (RTPINGPONGSPEAKER)ASMAtomicUoReadU32((volatile uint32_t *)&pPP->enmSpeaker); \
67 * @param pPP Pointer to the ping-pong structure which needs initialization.
69 RTDECL(int) RTSemPingPongInit(PRTPINGPONG pPP)
74 pPP->enmSpeaker = RTPINGPONGSPEAKER_PING;
76 int rc = RTSemEventCreate(&pPP->Ping);
79 rc = RTSemEventCreate(&pPP->Pong);
82 RTSemEventDestroy(pPP->Ping);
94 * @param pPP Pointer to the ping-pong structure which is to be destroyed.
97 RTDECL(int) RTSemPingPongDelete(PRTPINGPONG pPP)
102 if (!pPP)
105 RTSEMPP_VALIDATE_RETURN(pPP);
110 ASMAtomicWriteSize(&pPP->enmSpeaker, RTPINGPONGSPEAKER_UNINITIALIZE);
111 int rc = RTSemEventDestroy(pPP->Ping);
112 int rc2 = RTSemEventDestroy(pPP->Pong);
126 * @param pPP Pointer to the ping-pong structure to ping.
128 RTDECL(int) RTSemPing(PRTPINGPONG pPP)
134 RTSEMPP_VALIDATE_RETURN(pPP);
141 ASMAtomicWriteSize(&pPP->enmSpeaker, RTPINGPONGSPEAKER_PONG_SIGNALED);
142 int rc = RTSemEventSignal(pPP->Pong);
147 AssertMsgFailed(("Failed to signal pong sem %x. rc=%Rrc\n", pPP->Pong, rc));
148 ASMAtomicWriteSize(&pPP->enmSpeaker, RTPINGPONGSPEAKER_PING);
159 * @param pPP Pointer to the ping-pong structure to pong.
161 RTDECL(int) RTSemPong(PRTPINGPONG pPP)
167 RTSEMPP_VALIDATE_RETURN(pPP);
174 ASMAtomicWriteSize(&pPP->enmSpeaker, RTPINGPONGSPEAKER_PING_SIGNALED);
175 int rc = RTSemEventSignal(pPP->Ping);
180 AssertMsgFailed(("Failed to signal ping sem %x. rc=%Rrc\n", pPP->Ping, rc));
181 ASMAtomicWriteSize(&pPP->enmSpeaker, RTPINGPONGSPEAKER_PONG);
192 * @param pPP Pointer to the ping-pong structure to wait on.
195 RTDECL(int) RTSemPingWait(PRTPINGPONG pPP, RTMSINTERVAL cMillies)
201 RTSEMPP_VALIDATE_RETURN(pPP);
211 int rc = RTSemEventWait(pPP->Ping, cMillies);
213 ASMAtomicWriteSize(&pPP->enmSpeaker, RTPINGPONGSPEAKER_PING);
225 * @param pPP Pointer to the ping-pong structure to wait on.
228 RTDECL(int) RTSemPongWait(PRTPINGPONG pPP, RTMSINTERVAL cMillies)
234 RTSEMPP_VALIDATE_RETURN(pPP);
244 int rc = RTSemEventWait(pPP->Pong, cMillies);
246 ASMAtomicWriteSize(&pPP->enmSpeaker, RTPINGPONGSPEAKER_PONG);