VirtualBox

Changeset 102173 in vbox


Ignore:
Timestamp:
Nov 21, 2023 8:18:58 AM (12 months ago)
Author:
vboxsync
Message:

libs/xpcom/nsprpub: Convert PR_Atomic* to ASMAtomic*, bugref:10545 [regression fix, notify_pending must be signed or some checks whether the cond var is in use fail]

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

Legend:

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

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

    r102000 r102173  
    136136#if defined(DEBUG)
    137137            pt_debug.cvars_notified += 1;
    138             if (0 > ASMAtomicDecU32(&cv->notify_pending))
     138            if (0 > ASMAtomicDecS32(&cv->notify_pending))
    139139            {
    140140                pt_debug.delayed_cv_deletes += 1;
     
    142142            }
    143143#else  /* defined(DEBUG) */
    144             if (0 > ASMAtomicDecU32(&cv->notify_pending))
     144            if (0 > ASMAtomicDecS32(&cv->notify_pending))
    145145                PR_DestroyCondVar(cv);
    146146#endif  /* defined(DEBUG) */
     
    309309
    310310    /* A brand new entry in the array */
    311     (void)ASMAtomicIncU32(&cvar->notify_pending);
     311    (void)ASMAtomicIncS32(&cvar->notify_pending);
    312312    notified->cv[index].times = (broadcast) ? -1 : 1;
    313313    notified->cv[index].cv = cvar;
     
    338338PR_IMPLEMENT(void) PR_DestroyCondVar(PRCondVar *cvar)
    339339{
    340     if (0 > ASMAtomicDecU32(&cvar->notify_pending))
     340    if (0 > ASMAtomicDecS32(&cvar->notify_pending))
    341341    {
    342342        PRIntn rv = pthread_cond_destroy(&cvar->cv); Assert(0 == rv);
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