Changeset 30471 in vbox
- Timestamp:
- Jun 28, 2010 2:07:05 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/testcase/tstSupSem.cpp
r28800 r30471 37 37 #include <iprt/test.h> 38 38 #include <iprt/thread.h> 39 #include <iprt/process.h> 40 #include <iprt/env.h> 41 #include <iprt/string.h> 39 42 40 43 … … 76 79 } 77 80 81 if (argc == 2 && !strcmp(argv[1], "child")) 82 { 83 RTThreadSleep(300); 84 return 0; 85 } 86 78 87 RTTEST hTest; 79 88 rc = RTTestCreate("tstSupSem", &hTest); … … 188 197 RTTESTI_CHECK_RC(rcThread, VERR_INTERRUPTED); 189 198 RTTESTI_CHECK_RC(SUPSemEventMultiClose(pSession, hEventMulti), VINF_OBJECT_DESTROYED); 199 200 /* 201 * Fork test. 202 * Spawn a thread waiting for an event, then spawn a new child process (of ourselves) 203 * and make sure that this does not alter the intended behaviour of our event semaphore implementation (see #5090). 204 */ 205 RTTestSub(hTest, "Process spawn"); 206 hThread = NIL_RTTHREAD; 207 g_cMillies = 120*1000; 208 RTTESTI_CHECK_RC(SUPSemEventCreate(pSession, &hEvent), VINF_SUCCESS); 209 RTTESTI_CHECK_RC(RTThreadCreate(&hThread, tstSupSemInterruptibleSRE, (void *)hEvent, 0, RTTHREADTYPE_TIMER, RTTHREADFLAGS_WAITABLE, "IntSRE"), VINF_SUCCESS); 210 211 const char *apszArgs[3] = { argv[0], "child", NULL }; 212 RTPROCESS Process; 213 RTThreadSleep(250); 214 RTTESTI_CHECK_RC(RTProcCreate(apszArgs[0], apszArgs, RTENV_DEFAULT, 0, &Process), VINF_SUCCESS); 215 216 RTThreadSleep(250); 217 RTTESTI_CHECK_RC(SUPSemEventSignal(pSession, hEvent), VINF_SUCCESS); 218 219 rcThread = VINF_SUCCESS; 220 RTTESTI_CHECK_RC(RTThreadWait(hThread, 120*1000, &rcThread), VINF_SUCCESS); 221 RTTESTI_CHECK_RC(rcThread, VINF_SUCCESS); 222 RTTESTI_CHECK_RC(SUPSemEventClose(pSession, hEvent), VINF_OBJECT_DESTROYED); 223 190 224 #endif /* !OS2 && !WINDOWS */ 191 225
Note:
See TracChangeset
for help on using the changeset viewer.