VirtualBox

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


Ignore:
Timestamp:
Nov 7, 2023 9:57:12 AM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom/TestAutoLock: Convert to use a fast an IPRT mutex semaphore, bugref:10545

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestAutoLock.cpp

    r101895 r101921  
    5050#include <iprt/thread.h>
    5151
    52 PRLock* gLock;
     52RTSEMFASTMUTEX gLock;
    5353int gCount;
    5454
     
    7070int main(int argc, char** argv)
    7171{
    72     gLock = PR_NewLock();
    73     gCount = 0;
    74 
    7572    int vrc = RTR3InitExe(argc, &argv, 0);
    7673    if (RT_FAILURE(vrc))
    7774        return RTMsgInitFailure(vrc);
     75
     76    vrc = RTSemFastMutexCreate(&gLock);
     77    if (RT_FAILURE(vrc))
     78        return RTMsgInitFailure(vrc);
     79
     80    gCount = 0;
    7881
    7982    // This shouldn't compile
     
    99102    AssertRC(rcThread);
    100103
     104    RTSemFastMutexDestroy(gLock);
     105
    101106    return 0;
    102107}
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