Changeset 19923 in vbox
- Timestamp:
- May 22, 2009 5:53:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp
r19895 r19923 48 48 static PSUPDRVSESSION g_pSession; 49 49 static RTTEST g_hTest; 50 static uint32_t g_cMillies; /* Used by the interruptible tests. */ 50 51 51 52 … … 55 56 SUPSEMEVENT hEvent = (SUPSEMEVENT)pvUser; 56 57 RTThreadUserSignal(hSelf); 57 return SUPSemEventWaitNoResume(g_pSession, hEvent, RT_INDEFINITE_WAIT);58 return SUPSemEventWaitNoResume(g_pSession, hEvent, g_cMillies); 58 59 } 59 60 … … 63 64 SUPSEMEVENTMULTI hEventMulti = (SUPSEMEVENTMULTI)pvUser; 64 65 RTThreadUserSignal(hSelf); 65 return SUPSemEventMultiWaitNoResume(g_pSession, hEventMulti, RT_INDEFINITE_WAIT);66 return SUPSemEventMultiWaitNoResume(g_pSession, hEventMulti, g_cMillies); 66 67 } 67 68 … … 142 143 RTTestSub(hTest, "SRE Interruptibility"); 143 144 RTTESTI_CHECK_RC(SUPSemEventCreate(pSession, &hEvent), VINF_SUCCESS); 145 g_cMillies = RT_INDEFINITE_WAIT; 144 146 RTTHREAD hThread = NIL_RTTHREAD; 145 147 RTTESTI_CHECK_RC(RTThreadCreate(&hThread, tstSupSemInterruptibleSRE, (void *)hEvent, 0, RTTHREADTYPE_TIMER, RTTHREADFLAGS_WAITABLE, "IntSRE"), VINF_SUCCESS); … … 152 154 RTTESTI_CHECK_RC(SUPSemEventClose(pSession, hEvent), VINF_OBJECT_DESTROYED); 153 155 156 RTTESTI_CHECK_RC(SUPSemEventCreate(pSession, &hEvent), VINF_SUCCESS); 157 g_cMillies = 120*1000; 158 hThread = NIL_RTTHREAD; 159 RTTESTI_CHECK_RC(RTThreadCreate(&hThread, tstSupSemInterruptibleSRE, (void *)hEvent, 0, RTTHREADTYPE_TIMER, RTTHREADFLAGS_WAITABLE, "IntSRE"), VINF_SUCCESS); 160 RTTESTI_CHECK_RC(RTThreadUserWait(hThread, 60*1000), VINF_SUCCESS); 161 RTThreadSleep(120); 162 RTThreadPoke(hThread); 163 rcThread = VINF_SUCCESS; 164 RTTESTI_CHECK_RC(RTThreadWait(hThread, 60*1000, &rcThread), VINF_SUCCESS); 165 RTTESTI_CHECK_RC(rcThread, VERR_INTERRUPTED); 166 RTTESTI_CHECK_RC(SUPSemEventClose(pSession, hEvent), VINF_OBJECT_DESTROYED); 167 168 154 169 RTTestSub(hTest, "MRE Interruptibility"); 155 170 RTTESTI_CHECK_RC(SUPSemEventMultiCreate(pSession, &hEventMulti), VINF_SUCCESS); 171 g_cMillies = RT_INDEFINITE_WAIT; 156 172 hThread = NIL_RTTHREAD; 157 173 RTTESTI_CHECK_RC(RTThreadCreate(&hThread, tstSupSemInterruptibleMRE, (void *)hEventMulti, 0, RTTHREADTYPE_TIMER, RTTHREADFLAGS_WAITABLE, "IntMRE"), VINF_SUCCESS); … … 164 180 RTTESTI_CHECK_RC(SUPSemEventMultiClose(pSession, hEventMulti), VINF_OBJECT_DESTROYED); 165 181 166 #endif 182 RTTESTI_CHECK_RC(SUPSemEventMultiCreate(pSession, &hEventMulti), VINF_SUCCESS); 183 g_cMillies = 120*1000; 184 hThread = NIL_RTTHREAD; 185 RTTESTI_CHECK_RC(RTThreadCreate(&hThread, tstSupSemInterruptibleMRE, (void *)hEventMulti, 0, RTTHREADTYPE_TIMER, RTTHREADFLAGS_WAITABLE, "IntMRE"), VINF_SUCCESS); 186 RTTESTI_CHECK_RC(RTThreadUserWait(hThread, 60*1000), VINF_SUCCESS); 187 RTThreadSleep(120); 188 RTThreadPoke(hThread); 189 rcThread = VINF_SUCCESS; 190 RTTESTI_CHECK_RC(RTThreadWait(hThread, 60*1000, &rcThread), VINF_SUCCESS); 191 RTTESTI_CHECK_RC(rcThread, VERR_INTERRUPTED); 192 RTTESTI_CHECK_RC(SUPSemEventMultiClose(pSession, hEventMulti), VINF_OBJECT_DESTROYED); 193 #endif /* !OS2 && !WINDOWS */ 167 194 168 195 /*
Note:
See TracChangeset
for help on using the changeset viewer.