VirtualBox

Changeset 7922 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Apr 11, 2008 3:11:51 PM (17 years ago)
Author:
vboxsync
Message:

Fixed darwin build error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp

    r7920 r7922  
    4141#include "internal/magics.h"
    4242
     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
     48AssertCompileSize(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
    4353
    4454/*******************************************************************************
     
    155165    pthread_t Self = pthread_self();
    156166    pthread_t Writer;
    157     ASMAtomicReadSize(&pThis->Writer, &Writer);
     167    ATOMIC_GET_PTHREAD_T(&pThis->Writer, &Writer);
    158168    if (Writer == Self)
    159169    {
     
    236246    pthread_t Self = pthread_self();
    237247    pthread_t Writer;
    238     ASMAtomicReadSize(&pThis->Writer, &Writer);
     248    ATOMIC_GET_PTHREAD_T(&pThis->Writer, &Writer);
    239249    if (Writer == Self)
    240250    {
     
    275285    pthread_t Self = pthread_self();
    276286    pthread_t Writer;
    277     ASMAtomicReadSize(&pThis->Writer, &Writer);
     287    ATOMIC_GET_PTHREAD_T(&pThis->Writer, &Writer);
    278288    if (Writer == Self)
    279289    {
     
    328338    }
    329339
    330     ASMAtomicWriteSize(&pThis->Writer, Self);
     340    ATOMIC_SET_PTHREAD_T(&pThis->Writer, Self);
    331341    pThis->cWrites = 1;
    332342    return VINF_SUCCESS;
     
    357367    pthread_t Self = pthread_self();
    358368    pthread_t Writer;
    359     ASMAtomicReadSize(&pThis->Writer, &Writer);
     369    ATOMIC_GET_PTHREAD_T(&pThis->Writer, &Writer);
    360370    AssertMsgReturn(Writer == Self, ("pThis=%p\n", pThis), VERR_NOT_OWNER);
    361371    pThis->cWrites--;
     
    367377     * Try unlock it.
    368378     */
    369     ASMAtomicWriteSize(&pThis->Writer, (pthread_t)-1);
     379    ATOMIC_SET_PTHREAD_T(&pThis->Writer, (pthread_t)-1);
    370380    int rc = pthread_rwlock_unlock(&pThis->RWLock);
    371381    if (rc)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette