VirtualBox

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


Ignore:
Timestamp:
Nov 8, 2023 10:57:01 AM (15 months ago)
Author:
vboxsync
Message:

libs/xpcom: Convert ipcLockService.{cpp,h} to IPRT and remove some unused code, bugref:10545

Location:
trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/lock/src
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/lock/src/ipcLockService.cpp

    r1 r101959  
    4444#include "ipcLockProtocol.h"
    4545#include "ipcLog.h"
    46 #include "prthread.h"
     46
     47#include <iprt/errcore.h>
    4748
    4849static const nsID kLockTargetID = IPC_LOCK_TARGETID;
     
    6263ipcLockService::Init()
    6364{
    64     if (PR_NewThreadPrivateIndex(&mTPIndex, nsnull) != PR_SUCCESS)
     65    mTPIndex = RTTlsAlloc(); /** @todo r=aeichner This doesn't seem to get freed ever. */
     66    if (mTPIndex == NIL_RTTLS)
    6567        return NS_ERROR_OUT_OF_MEMORY;
    6668
     
    9496    pendingLock.status = 0xDEADBEEF; // something bogus
    9597    pendingLock.complete = PR_FALSE;
    96     if (PR_SetThreadPrivate(mTPIndex, &pendingLock) != PR_SUCCESS)
     98    if (RTTlsSet(mTPIndex, &pendingLock) != VINF_SUCCESS)
    9799        return NS_ERROR_UNEXPECTED;
    98100
     
    152154    LOG(("ipcLockService::OnMessageAvailable [lock=%s opcode=%u]\n", msg.key, msg.opcode));
    153155
    154     ipcPendingLock *pendingLock = (ipcPendingLock *) PR_GetThreadPrivate(mTPIndex);
     156    ipcPendingLock *pendingLock = (ipcPendingLock *) RTTlsGet(mTPIndex);
    155157    if (strcmp(pendingLock->name, msg.key) == 0) {
    156158        pendingLock->complete = PR_TRUE;
  • trunk/src/libs/xpcom18a4/ipc/ipcd/extensions/lock/src/ipcLockService.h

    r1 r101959  
    4343#include "ipcdclient.h"
    4444
     45#include <iprt/thread.h>
     46
    4547//-----------------------------------------------------------------------------
    4648
     
    5658
    5759private:
    58     PRUintn mTPIndex;
     60    RTTLS mTPIndex;
    5961};
    6062
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