vbox的更動 63584 路徑 trunk/src/VBox/Main/include/MachineImpl.h
- 時間撮記:
- 2016-8-18 上午11:48:04 (8 年 以前)
- 檔案:
-
- 修改 1 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Main/include/MachineImpl.h
r62141 r63584 39 39 #include "Performance.h" 40 40 #include "PerformanceImpl.h" 41 #include "ThreadTask.h" 41 42 #endif /* VBOX_WITH_RESOURCE_USAGE_API */ 42 43 … … 790 791 * in here (implemented by the subclasses). 791 792 */ 792 struct Task 793 { 793 class Task : public ThreadTask 794 { 795 public: 794 796 Task(Machine *m, Progress *p, const Utf8Str &t) 795 : m_pMachine(m), 797 : ThreadTask(t), 798 m_pMachine(m), 796 799 m_machineCaller(m), 797 800 m_pProgress(p), 798 m_strTaskName(t),799 801 m_machineStateBackup(m->mData->mMachineState) // save the current machine state 800 802 {} 801 803 virtual ~Task(){} 802 803 HRESULT createThread()804 {805 int vrc = RTThreadCreate(NULL,806 taskHandler,807 (void *)this,808 0,809 RTTHREADTYPE_MAIN_WORKER,810 0,811 m_strTaskName.c_str());812 if (RT_FAILURE(vrc))813 {814 HRESULT rc = Machine::i_setErrorStatic(E_FAIL, Machine::tr("Could not create thread \"%s\" (%Rrc)"), m_strTaskName.c_str(), vrc);815 delete this;816 return rc;817 }818 return S_OK;819 }820 804 821 805 void modifyBackedUpState(MachineState_T s) … … 824 808 } 825 809 826 virtual void handler() = 0; 827 828 ComObjPtr<Machine> m_pMachine; 810 ComObjPtr<Machine> m_pMachine; 829 811 AutoCaller m_machineCaller; 830 812 ComObjPtr<Progress> m_pProgress; 831 Utf8Str m_strTaskName;832 813 const MachineState_T m_machineStateBackup; 833 814 }; 834 815 835 structDeleteConfigTask;816 class DeleteConfigTask; 836 817 void i_deleteConfigHandler(DeleteConfigTask &task); 837 838 static DECLCALLBACK(int) taskHandler(RTTHREAD thread, void *pvUser);839 818 840 819 friend class SessionMachine; … … 1437 1416 }; 1438 1417 1439 struct SaveStateTask; 1440 struct SnapshotTask; 1441 struct TakeSnapshotTask; 1442 struct DeleteSnapshotTask; 1443 struct RestoreSnapshotTask; 1444 1445 friend struct TakeSnapshotTask; 1446 friend struct DeleteSnapshotTask; 1447 friend struct RestoreSnapshotTask; 1418 class SaveStateTask; 1419 class SnapshotTask; 1420 class TakeSnapshotTask; 1421 class DeleteSnapshotTask; 1422 class RestoreSnapshotTask; 1448 1423 1449 1424 void i_saveStateHandler(SaveStateTask &aTask);
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器