VirtualBox

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


Ignore:
Timestamp:
Nov 9, 2023 10:29:28 AM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom/ipc: Convert ipcDConnectService.cpp from nsIThread to IPRT's thread API, bugref:10545

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/dconnect/src/ipcDConnectService.cpp

    r101982 r102015  
    6666
    6767#if !defined(DCONNECT_WITH_IPRT_REQ_POOL)
    68 #include "nsIThread.h"
    6968#include "nsIRunnable.h"
    7069#endif
     
    29032902  DConnectWorker(ipcDConnectService *aDConnect) : mDConnect (aDConnect), mIsRunnable (PR_FALSE) {}
    29042903  NS_HIDDEN_(nsresult) Init();
    2905   NS_HIDDEN_(void) Join() { mThread->Join(); };
     2904  NS_HIDDEN_(void) Join()
     2905  {
     2906    int rcThread;
     2907    int vrc = RTThreadWait(mThread, RT_INDEFINITE_WAIT, &rcThread);
     2908    AssertRC(vrc); RT_NOREF(vrc);
     2909    AssertRC(rcThread);
     2910  };
    29062911  NS_HIDDEN_(bool) IsRunning() { return mIsRunnable; };
    29072912
    29082913private:
    2909   nsCOMPtr <nsIThread> mThread;
     2914
     2915  static DECLCALLBACK(int) dconnectWorkerRun(RTTHREAD hSelf, void *pvUser);
     2916
     2917  RTTHREAD           mThread;
    29102918  ipcDConnectService *mDConnect;
    29112919
     
    29162924NS_IMPL_QUERY_INTERFACE1(DConnectWorker, nsIRunnable)
    29172925
     2926/*static*/
     2927DECLCALLBACK(int) DConnectWorker::dconnectWorkerRun(RTTHREAD hSelf, void *pvUser)
     2928{
     2929  DConnectWorker *pThis = (DConnectWorker *)pvUser;
     2930  pThis->Run();
     2931  return VINF_SUCCESS;
     2932}
     2933
     2934
    29182935nsresult
    29192936DConnectWorker::Init()
    29202937{
    2921   return NS_NewThread(getter_AddRefs(mThread), this, 0, PR_JOINABLE_THREAD);
     2938  int vrc = RTThreadCreate(&mThread, dconnectWorkerRun, this, 0 /*cbStack*/,
     2939                           RTTHREADTYPE_IO, RTTHREADFLAGS_WAITABLE, "DConWrk");
     2940  if (RT_FAILURE(vrc))
     2941    return NS_ERROR_FAILURE;
     2942
     2943  return NS_OK;
    29222944}
    29232945
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