Changeset 7922 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Apr 11, 2008 3:11:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp
r7920 r7922 41 41 #include "internal/magics.h" 42 42 43 /** @todo move this to r3/posix/something.h. */ 44 #ifdef RT_OS_SOLARIS 45 # define ATOMIC_GET_PTHREAD_T(pvVar, pThread) ASMAtomicReadSize(pvVar, pThread) 46 # define ATOMIC_SET_PTHREAD_T(pvVar, pThread) ASMAtomicReadSize(pvVar, pThread) 47 #else 48 AssertCompileSize(pthread_t, sizeof(void *)); 49 # define ATOMIC_GET_PTHREAD_T(pvVar, pThread) do { *(pThread) = (pthread_t)ASMAtomicReadPtr((void *volatile *)pvVar); } while (0) 50 # define ATOMIC_SET_PTHREAD_T(pvVar, pThread) ASMAtomicWritePtr((void *volatile *)pvVar, (void *)pThread) 51 #endif 52 43 53 44 54 /******************************************************************************* … … 155 165 pthread_t Self = pthread_self(); 156 166 pthread_t Writer; 157 A SMAtomicReadSize(&pThis->Writer, &Writer);167 ATOMIC_GET_PTHREAD_T(&pThis->Writer, &Writer); 158 168 if (Writer == Self) 159 169 { … … 236 246 pthread_t Self = pthread_self(); 237 247 pthread_t Writer; 238 A SMAtomicReadSize(&pThis->Writer, &Writer);248 ATOMIC_GET_PTHREAD_T(&pThis->Writer, &Writer); 239 249 if (Writer == Self) 240 250 { … … 275 285 pthread_t Self = pthread_self(); 276 286 pthread_t Writer; 277 A SMAtomicReadSize(&pThis->Writer, &Writer);287 ATOMIC_GET_PTHREAD_T(&pThis->Writer, &Writer); 278 288 if (Writer == Self) 279 289 { … … 328 338 } 329 339 330 A SMAtomicWriteSize(&pThis->Writer, Self);340 ATOMIC_SET_PTHREAD_T(&pThis->Writer, Self); 331 341 pThis->cWrites = 1; 332 342 return VINF_SUCCESS; … … 357 367 pthread_t Self = pthread_self(); 358 368 pthread_t Writer; 359 A SMAtomicReadSize(&pThis->Writer, &Writer);369 ATOMIC_GET_PTHREAD_T(&pThis->Writer, &Writer); 360 370 AssertMsgReturn(Writer == Self, ("pThis=%p\n", pThis), VERR_NOT_OWNER); 361 371 pThis->cWrites--; … … 367 377 * Try unlock it. 368 378 */ 369 A SMAtomicWriteSize(&pThis->Writer, (pthread_t)-1);379 ATOMIC_SET_PTHREAD_T(&pThis->Writer, (pthread_t)-1); 370 380 int rc = pthread_rwlock_unlock(&pThis->RWLock); 371 381 if (rc)
Note:
See TracChangeset
for help on using the changeset viewer.