VirtualBox

Changeset 101968 in vbox for trunk/src/libs/xpcom18a4


Ignore:
Timestamp:
Nov 8, 2023 12:48:34 PM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom/nsprpub: Convert PR_Atomic* to ASMAtomic*, bugref:10545

Location:
trunk/src/libs/xpcom18a4/nsprpub/pr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r101964 r101968  
    333333    PRLock *lock;               /* associated lock that protects the condition */
    334334    pthread_cond_t cv;          /* underlying pthreads condition */
    335     PRInt32 notify_pending;     /* CV has destroy pending notification */
     335    volatile uint32_t notify_pending;     /* CV has destroy pending notification */
    336336};
    337337
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptsynch.c

    r101904 r101968  
    4848#include <sys/time.h>
    4949
     50#include <iprt/asm.h>
     51
    5052#ifdef VBOX
    5153/* From the removed obsolete/prsem.h */
     
    133135#if defined(DEBUG)
    134136            pt_debug.cvars_notified += 1;
    135             if (0 > PR_AtomicDecrement(&cv->notify_pending))
     137            if (0 > ASMAtomicDecU32(&cv->notify_pending))
    136138            {
    137139                pt_debug.delayed_cv_deletes += 1;
     
    139141            }
    140142#else  /* defined(DEBUG) */
    141             if (0 > PR_AtomicDecrement(&cv->notify_pending))
     143            if (0 > ASMAtomicDecU32(&cv->notify_pending))
    142144                PR_DestroyCondVar(cv);
    143145#endif  /* defined(DEBUG) */
     
    306308
    307309    /* A brand new entry in the array */
    308     (void)PR_AtomicIncrement(&cvar->notify_pending);
     310    (void)ASMAtomicIncU32(&cvar->notify_pending);
    309311    notified->cv[index].times = (broadcast) ? -1 : 1;
    310312    notified->cv[index].cv = cvar;
     
    335337PR_IMPLEMENT(void) PR_DestroyCondVar(PRCondVar *cvar)
    336338{
    337     if (0 > PR_AtomicDecrement(&cvar->notify_pending))
     339    if (0 > ASMAtomicDecU32(&cvar->notify_pending))
    338340    {
    339341        PRIntn rv = pthread_cond_destroy(&cvar->cv); PR_ASSERT(0 == rv);
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptthread.c

    r101963 r101968  
    5050#include <signal.h>
    5151
     52#include <iprt/asm.h>
    5253#include <iprt/thread.h>
    5354#include <iprt/mem.h>
     
    498499    {
    499500        PRIntn rv;
    500         (void)PR_AtomicIncrement(&cv->notify_pending);
     501        ASMAtomicIncU32(&cv->notify_pending);
    501502        rv = pthread_cond_broadcast(&cv->cv);
    502503        PR_ASSERT(0 == rv);
    503         if (0 > PR_AtomicDecrement(&cv->notify_pending))
     504        if (0 > ASMAtomicDecU32(&cv->notify_pending))
    504505            PR_DestroyCondVar(cv);
    505506    }
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