VirtualBox

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


Ignore:
Timestamp:
Nov 8, 2023 3:04:09 PM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom: Convert PR_Sleep to RTThreadSleep/RTThreadYield, bugref:10545

Location:
trunk/src/libs/xpcom18a4
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/daemon/src/ipcdUnix.cpp

    r101933 r101982  
    6767#include "ipcdPrivate.h"
    6868#include "ipcd.h"
    69 
    70 #if 0
    71 static void
    72 IPC_Sleep(int seconds)
    73 {
    74     while (seconds > 0) {
    75         LOG(("\rsleeping for %d seconds...", seconds));
    76         PR_Sleep(PR_SecondsToInterval(1));
    77         --seconds;
    78     }
    79     LOG(("\ndone sleeping\n"));
    80 }
    81 #endif
    8269
    8370//-----------------------------------------------------------------------------
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp

    r101966 r101982  
    35493549
    35503550  // Yield the cpu so a worker can get a chance to start working without too much fuss.
    3551   PR_Sleep(PR_INTERVAL_NO_WAIT);
     3551  RTThreadYield();
    35523552  mon.Enter();
    35533553  // examine the queue
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptio.c

    r101964 r101982  
    7878#endif
    7979#endif
     80
     81#include <iprt/thread.h>
    8082
    8183#ifdef DARWIN
     
    21362138    if (pt_TestAbort()) return -1;
    21372139
    2138     if (0 == npds) PR_Sleep(timeout);
     2140    if (0 == npds) RTThreadSleep(PR_IntervalToMilliseconds(timeout));
    21392141    else
    21402142    {
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestThreads.cpp

    r101895 r101982  
    4444#include "nsIServiceManager.h"
    4545
     46#include <iprt/thread.h>
     47
    4648class nsRunner : public nsIRunnable {
    4749public:
     
    5961        // if we don't do something slow, we'll never see the other
    6062        // worker threads run
    61         PR_Sleep(PR_MillisecondsToInterval(100));
     63        RTThreadSleep(100);
    6264
    6365        return rv;
     
    126128    }
    127129
    128     PR_Sleep(PR_MillisecondsToInterval(100));       // hopefully the runner will quit here
     130    RTThreadSleep(100);       // hopefully the runner will quit here
    129131
    130132    return NS_OK;
  • trunk/src/libs/xpcom18a4/xpcom/threads/nsThread.cpp

    r101960 r101982  
    300300    if (PR_GetCurrentThread() != mThread)
    301301        return NS_ERROR_FAILURE;
    302    
    303     if (PR_Sleep(PR_MillisecondsToInterval(msec)) != PR_SUCCESS)
     302
     303    if (RTThreadSleep(msec) != VINF_SUCCESS)
    304304        return NS_ERROR_FAILURE;
    305305
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