Changeset 33150 in vbox for trunk/src/VBox/Runtime/r0drv/solaris
- Timestamp:
- Oct 15, 2010 11:36:00 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r0drv/solaris/semeventwait-r0drv-solaris.h
r33149 r33150 35 35 #include <iprt/time.h> 36 36 37 38 /** The resolution (nanoseconds) specified when using timeout_generic. */ 39 #define RTR0SEMSOLWAIT_RESOLUTION 50000 40 41 37 42 /** 38 43 * Solaris semaphore wait structure. … … 40 45 typedef struct RTR0SEMSOLWAIT 41 46 { 42 /** The absolute timeout given as nano 47 /** The absolute timeout given as nanoseconds since the start of the 43 48 * monotonic clock. */ 44 49 uint64_t uNsAbsTimeout; 45 /** The timeout in nano 50 /** The timeout in nanoseconds relative to the start of the wait. */ 46 51 uint64_t cNsRelTimeout; 47 52 /** The native timeout value. */ … … 213 218 DECLINLINE(void) rtR0SemSolWaitDoIt(PRTR0SEMSOLWAIT pWait, kcondvar_t *pCnd, kmutex_t *pMtx) 214 219 { 215 int rc = 1;216 220 union 217 221 { … … 235 239 */ 236 240 u.idCo = g_pfnrtR0Sol_timeout_generic(CALLOUT_REALTIME, rtR0SemSolWaitTimeout, pWait, 237 pWait->uNsAbsTimeout, 50000 /*res*/,241 pWait->uNsAbsTimeout, RTR0SEMSOLWAIT_RESOLUTION, 238 242 CALLOUT_FLAG_ABSOLUTE); 239 243 } … … 271 275 /* 272 276 * Do the waiting. 277 * (rc > 0 - normal wake-up; rc == 0 - interruption; rc == -1 - timeout) 273 278 */ 279 int rc; 274 280 if (pWait->fInterruptible) 275 rc = cv_wait_sig(pCnd, pMtx); 281 { 282 int rc = cv_wait_sig(pCnd, pMtx); 283 if (RT_UNLIKELY(rc <= 0)) 284 { 285 if (RT_LIKELY(rc == 0)) 286 pWait->fInterrupted = true; 287 else 288 AssertMsgFailed(("rc=%d\n", rc)); /* no timeouts, see above! */ 289 } 290 } 276 291 else 277 292 cv_wait(pCnd, pMtx); … … 306 321 mutex_enter(pMtx); 307 322 } 308 309 /*310 * Above zero means normal wake-up.311 * Interruption is signalled by 0, timeouts by -1.312 */313 if (RT_UNLIKELY(rc <= 0))314 {315 if (RT_LIKELY(rc == 0))316 pWait->fInterrupted = true;317 else318 AssertMsgFailed(("rc=%d\n", rc)); /* no timeouts, see above! */319 }320 323 } 321 324 … … 355 358 pWait->pThread = NULL; 356 359 } 360 357 361 358 362 /** … … 390 394 } 391 395 396 397 /** 398 * Gets the max resolution of the timeout machinery. 399 * 400 * @returns Resolution specified in nanoseconds. 401 */ 402 DECLINLINE(uint32_t) rtR0SemSolWaitGetResolution(void) 403 { 404 return g_pfnrtR0Sol_timeout_generic != NULL 405 ? RTR0SEMSOLWAIT_RESOLUTION 406 : cyclic_getres(); 407 } 408 392 409 #endif
Note:
See TracChangeset
for help on using the changeset viewer.