VirtualBox

Changeset 28087 in vbox


Ignore:
Timestamp:
Apr 8, 2010 12:46:03 PM (15 years ago)
Author:
vboxsync
Message:

Guest Control/HostService: No need for locking.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/GuestControl/service.cpp

    r28086 r28087  
    3636#include <iprt/cpp/autores.h>
    3737#include <iprt/cpp/utils.h>
    38 #include <iprt/critsect.h>
    3938#include <iprt/err.h>
    4039#include <iprt/mem.h>
     
    118117    /** The host command list */
    119118    HostCmdList mHostCmds;
    120     RTCRITSECT critsect;
    121119
    122120public:
     
    135133                                "GuestCtrlReq");
    136134#endif
    137         if (RT_SUCCESS(rc))
    138             rc = RTCritSectInit(&critsect);
    139 
    140135        if (RT_FAILURE(rc))
    141136            throw rc;
     
    275270int Service::execBufferAllocate(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    276271{
    277     RTCritSectEnter(&critsect);
    278 
    279272    AssertPtr(pBuf);
    280273    int rc = VINF_SUCCESS;
     
    333326        }
    334327    }
    335     RTCritSectLeave(&critsect);
    336328    return rc;
    337329}
     
    340332void Service::execBufferFree(PVBOXGUESTCTRPARAMBUFFER pBuf)
    341333{
    342     RTCritSectEnter(&critsect);
    343334    AssertPtr(pBuf);
    344335    for (uint32_t i = 0; i < pBuf->uParmCount; i++)
     
    357348        pBuf->uParmCount = 0;
    358349    }
    359     RTCritSectLeave(&critsect);
    360350}
    361351
     
    363353int Service::execBufferAssign(PVBOXGUESTCTRPARAMBUFFER pBuf, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    364354{
    365     RTCritSectEnter(&critsect);
    366 
    367355    AssertPtr(pBuf);
    368356    int rc = VINF_SUCCESS;
     
    398386        }
    399387    }
    400     RTCritSectLeave(&critsect);
    401388    return rc;
    402389}
     
    422409    int rc = VINF_SUCCESS;
    423410
    424     /** @todo !!!!! LOCKING !!!!!!!!! */
    425 
    426411    if (cParms < 2)
    427412    {
     
    430415    }
    431416    else
    432     {     
    433         /* 
     417    {
     418        /*
    434419         * If host command list is empty (nothing to do right now) just
    435420         * defer the call until we got something to do (makes the client
     
    466451             else
    467452             {
    468                  rc = execBufferAssign(&curCmd.parmBuf, cParms, paParms);                 
     453                 rc = execBufferAssign(&curCmd.parmBuf, cParms, paParms);
    469454                 if (RT_SUCCESS(rc))
    470455                     mHostCmds.pop_front();
     
    487472int Service::hostNotifyGuest(GuestCall *pCall, uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    488473{
    489     /** @todo !!!!! LOCKING !!!!!!!!! */
    490 
    491474    AssertPtr(pCall);
    492     int rc = VINF_SUCCESS;   
     475    int rc = VINF_SUCCESS;
    493476
    494477    int rc2 = guestGetHostMsg(pCall->mHandle, pCall->mNumParms, pCall->mParms);
     
    502485int Service::hostProcessCmd(uint32_t eFunction, uint32_t cParms, VBOXHGCMSVCPARM paParms[])
    503486{
    504     /** @todo !!!!! LOCKING !!!!!!!!! */
    505 
    506487    int rc = VINF_SUCCESS;
    507488
     
    549530            /* The guest asks the host for the next messsage to process. */
    550531            case GUEST_GET_HOST_MSG:
    551                 LogFlowFunc(("GUEST_GET_HOST_MSG\n"));               
     532                LogFlowFunc(("GUEST_GET_HOST_MSG\n"));
    552533                rc = guestGetHostMsg(callHandle, cParms, paParms);
    553534                break;
     
    571552                rc = VERR_NOT_IMPLEMENTED;
    572553        }
    573         /* 
    574          * If current call is not deferred, call the completion function. 
     554        /*
     555         * If current call is not deferred, call the completion function.
    575556         */
    576557        if (rc != VINF_HGCM_ASYNC_EXECUTE)
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