VirtualBox

Changeset 64972 in vbox


Ignore:
Timestamp:
Dec 21, 2016 11:38:12 AM (8 years ago)
Author:
vboxsync
Message:

Main: ThreadTask: m_hThread shouldn't be an object member

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/ThreadTask.h

    r64108 r64972  
    3535public:
    3636    ThreadTask(const Utf8Str &t)
    37         : m_hThread(NIL_RTTHREAD)
    38         , m_strTaskName(t)
     37        : m_strTaskName(t)
    3938        , mAsync(false)
    4039    { }
     
    5453    static DECLCALLBACK(int) taskHandlerThreadProc(RTTHREAD thread, void *pvUser);
    5554
    56     ThreadTask() : m_hThread(NIL_RTTHREAD), m_strTaskName("GenericTask")
     55    ThreadTask() : m_strTaskName("GenericTask")
    5756    { }
    5857
    5958    /** The worker thread handle (may be invalid if the thread has shut down). */
    60     RTTHREAD m_hThread;
    6159    Utf8Str m_strTaskName;
    6260    bool mAsync;
  • trunk/src/VBox/Main/src-all/ThreadTask.cpp

    r64108 r64972  
    8888HRESULT ThreadTask::createThreadInternal(RTTHREADTYPE enmType, PRTTHREAD phThread)
    8989{
    90     int vrc = RTThreadCreate(&m_hThread,
     90    RTTHREAD hThread;
     91    int vrc = RTThreadCreate(&hThread,
    9192                             taskHandlerThreadProc,
    9293                             (void *)this,
     
    99100        mAsync = true;
    100101        if (phThread)
    101             *phThread = m_hThread;
     102            *phThread = hThread;
    102103        return S_OK;
    103104    }
     
    124125    pTask->handler();
    125126
    126     pTask->m_hThread = NIL_RTTHREAD; /* unnecessary, but whatever. */
    127127    delete pTask;
    128128    return VINF_SUCCESS;
  • trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp

    r64964 r64972  
    39703970}
    39713971
    3972 static DECLCALLBACK(int) fntSaveMediaRegistries(RTTHREAD ThreadSelf, void *pvUser);
     3972static DECLCALLBACK(int) fntSaveMediaRegistries(void *pvUser);
    39733973
    39743974class SaveMediaRegistriesDesc : public ThreadTask
     
    39873987        try
    39883988        {
    3989             fntSaveMediaRegistries(m_hThread, this);
     3989            fntSaveMediaRegistries(this);
    39903990        }
    39913991        catch(...)
     
    39983998    ComObjPtr<VirtualBox> pVirtualBox;
    39993999
    4000     friend DECLCALLBACK(int) fntSaveMediaRegistries(RTTHREAD ThreadSelf, void *pvUser);
     4000    friend DECLCALLBACK(int) fntSaveMediaRegistries(void *pvUser);
    40014001    friend void VirtualBox::i_saveMediaRegistry(settings::MediaRegistry &mediaRegistry,
    40024002                                                const Guid &uuidRegistry,
     
    40044004};
    40054005
    4006 DECLCALLBACK(int) fntSaveMediaRegistries(RTTHREAD ThreadSelf, void *pvUser)
    4007 {
    4008     NOREF(ThreadSelf);
     4006DECLCALLBACK(int) fntSaveMediaRegistries(void *pvUser)
     4007{
    40094008    SaveMediaRegistriesDesc *pDesc = (SaveMediaRegistriesDesc *)pvUser;
    40104009    if (!pDesc)
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