VirtualBox

Changeset 63183 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Aug 8, 2016 4:37:26 PM (8 years ago)
Author:
vboxsync
Message:

ThreadTask: Dealt with totally misguided m_pThread member. Started cleaning up handler() methods.

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestDnDSourceImpl.cpp

    r63182 r63183  
    8686    void handler()
    8787    {
    88         int vrc = GuestDnDSource::i_receiveDataThread(*m_pThread, this);
     88        GuestDnDSource::i_receiveDataThreadTask(this);
    8989    }
    9090
     
    962962#endif /* VBOX_WITH_DRAG_AND_DROP_GH */
    963963
     964/**
     965 * @returns VBox status code that the caller ignores. Not sure if that's
     966 *          intentional or not.
     967 */
    964968int GuestDnDSource::i_receiveData(PRECVDATACTX pCtx, RTMSINTERVAL msTimeout)
    965969{
     
    10621066
    10631067/* static */
    1064 DECLCALLBACK(int) GuestDnDSource::i_receiveDataThread(RTTHREAD Thread, void *pvUser)
    1065 {
    1066     LogFlowFunc(("pvUser=%p\n", pvUser));
    1067 
    1068     RecvDataTask *pTask = (RecvDataTask *)pvUser;
    1069     AssertPtrReturn(pTask, VERR_INVALID_POINTER);
     1068DECLCALLBACK(void) GuestDnDSource::i_receiveDataThreadTask(RecvDataTask *pTask)
     1069{
     1070    LogFlowFunc(("pTask=%p\n", pTask));
     1071    AssertPtrReturnVoid(pTask);
    10701072
    10711073    const ComObjPtr<GuestDnDSource> pThis(pTask->getSource());
     
    10731075
    10741076    AutoCaller autoCaller(pThis);
    1075     if (FAILED(autoCaller.rc())) return VERR_COM_INVALID_OBJECT_STATE;
    1076 
    1077     int rc = RTThreadUserSignal(Thread);
    1078     AssertRC(rc);
    1079 
    1080     rc = pThis->i_receiveData(pTask->getCtx(), RT_INDEFINITE_WAIT /* msTimeout */);
     1077    if (FAILED(autoCaller.rc()))
     1078        return;
     1079
     1080    int vrc = RTThreadUserSignal(RTThreadSelf());
     1081    AssertRC(vrc);
     1082
     1083    vrc = pThis->i_receiveData(pTask->getCtx(), RT_INDEFINITE_WAIT /* msTimeout */);
     1084/** @todo
     1085 *
     1086 *  r=bird: What happens with @a vrc?
     1087 *
     1088 */
    10811089
    10821090    AutoWriteLock alock(pThis COMMA_LOCKVAL_SRC_POS);
     
    10851093    pThis->mDataBase.m_cTransfersPending--;
    10861094
    1087     LogFlowFunc(("pSource=%p returning rc=%Rrc\n", (GuestDnDSource *)pThis, rc));
    1088     return rc;
     1095    LogFlowFunc(("pSource=%p vrc=%Rrc (ignored)\n", (GuestDnDSource *)pThis, vrc));
    10891096}
    10901097
  • trunk/src/VBox/Main/src-client/GuestDnDTargetImpl.cpp

    r63182 r63183  
    9090    void handler()
    9191    {
    92         int vrc = GuestDnDTarget::i_sendDataThread(*m_pThread, this);
    93         NOREF(vrc);
     92        GuestDnDTarget::i_sendDataThreadTask(this);
    9493    }
    9594
     
    558557
    559558/* static */
    560 DECLCALLBACK(int) GuestDnDTarget::i_sendDataThread(RTTHREAD Thread, void *pvUser)
    561 {
    562     LogFlowFunc(("pvUser=%p\n", pvUser));
    563 
    564     SendDataTask *pTask = (SendDataTask *)pvUser;
    565     AssertPtrReturn(pTask, VERR_INVALID_POINTER);
     559void GuestDnDTarget::i_sendDataThreadTask(SendDataTask *pTask)
     560{
     561    LogFlowFunc(("pTask=%p\n", pTask));
     562
     563    AssertPtrReturnVoid(pTask);
    566564
    567565    const ComObjPtr<GuestDnDTarget> pThis(pTask->getTarget());
     
    569567
    570568    AutoCaller autoCaller(pThis);
    571     if (FAILED(autoCaller.rc())) return VERR_COM_INVALID_OBJECT_STATE;
    572 
    573     int rc = RTThreadUserSignal(Thread);
    574     AssertRC(rc);
    575 
    576     rc = pThis->i_sendData(pTask->getCtx(), RT_INDEFINITE_WAIT /* msTimeout */);
     569    if (FAILED(autoCaller.rc()))
     570        return;
     571
     572    int vrc = RTThreadUserSignal(RTThreadSelf());
     573    AssertRC(vrc);
     574
     575    vrc = pThis->i_sendData(pTask->getCtx(), RT_INDEFINITE_WAIT /* msTimeout */);
     576/** @todo
     577 *
     578 *  r=bird: What happens with @a vrc?
     579 *
     580 */
    577581
    578582    AutoWriteLock alock(pThis COMMA_LOCKVAL_SRC_POS);
     
    581585    pThis->mDataBase.m_cTransfersPending--;
    582586
    583     LogFlowFunc(("pTarget=%p returning rc=%Rrc\n", (GuestDnDTarget *)pThis, rc));
    584     return rc;
     587    LogFlowFunc(("pTarget=%p vrc=%Rrc (ignored)\n", (GuestDnDTarget *)pThis, vrc));
    585588}
    586589
     
    779782}
    780783
     784/**
     785 * @returns VBox status code that the caller ignores. Not sure if that's
     786 *          intentional or not.
     787 */
    781788int GuestDnDTarget::i_sendData(PSENDDATACTX pCtx, RTMSINTERVAL msTimeout)
    782789{
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