- Timestamp:
- Sep 3, 2015 2:38:36 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r57591 r57611 59 59 # include "QIDialogButtonBox.h" 60 60 # include "UIIconPool.h" 61 # include "UIThreadPool.h" 61 62 # include "UIShortcutPool.h" 62 63 # include "UIExtraDataManager.h" … … 255 256 , mSettingsPwSet(false) 256 257 , m_pIconPool(0) 258 , m_pThreadPool(0) 257 259 { 258 260 /* Assign instance: */ … … 4058 4060 this, SLOT(sltHandleVBoxSVCAvailabilityChange(bool))); 4059 4061 4062 /* Prepare thread-pool instance: */ 4063 m_pThreadPool = new UIThreadPool(3 /* worker count */, 5000 /* worker timeout */); 4064 4060 4065 /* create default non-null global settings */ 4061 4066 gset = VBoxGlobalSettings (false); … … 4452 4457 UIConverter::cleanup(); 4453 4458 4459 /* Cleanup thread-pool: */ 4460 delete m_pThreadPool; 4461 m_pThreadPool = 0; 4454 4462 /* Cleanup general icon-pool: */ 4455 4463 delete m_pIconPool; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r57590 r57611 65 65 class UIMedium; 66 66 class UIIconPoolGeneral; 67 class UIThreadPool; 67 68 #ifdef Q_WS_X11 68 69 class UIDesktopWidgetWatchdog; … … 139 140 /** Returns the VBoxSVC availability value. */ 140 141 bool isVBoxSVCAvailable() const { return m_fVBoxSVCAvailable; } 142 143 /** Returns the thread-pool instance. */ 144 UIThreadPool* threadPool() const { return m_pThreadPool; } 141 145 142 146 /** @name Host-screen geometry stuff … … 638 642 /** General icon-pool. */ 639 643 UIIconPoolGeneral *m_pIconPool; 644 /** Holds the thread-pool instance. */ 645 UIThreadPool *m_pThreadPool; 640 646 641 647 /* API: Instance stuff: */ -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r56125 r57611 69 69 70 70 71 UIMediumEnumerator::UIMediumEnumerator(ulong uWorkerCount /* = 3*/, ulong uWorkerTimeout /* = 5000*/) 72 : m_pThreadPool(0) 73 , m_fMediumEnumerationInProgress(false) 71 UIMediumEnumerator::UIMediumEnumerator() 72 : m_fMediumEnumerationInProgress(false) 74 73 { 75 74 /* Allow UIMedium to be used in inter-thread signals: */ … … 84 83 connect(gVBoxEvents, SIGNAL(sigMachineRegistered(QString, bool)), this, SLOT(sltHandleMachineRegistration(QString, bool))); 85 84 86 /* Prepare thread-pool: */ 87 m_pThreadPool = new UIThreadPool(uWorkerCount, uWorkerTimeout); 88 connect(m_pThreadPool, SIGNAL(sigTaskComplete(UITask*)), this, SLOT(sltHandleMediumEnumerationTaskComplete(UITask*))); 85 /* Listen for global thread-pool: */ 86 connect(vboxGlobal().threadPool(), SIGNAL(sigTaskComplete(UITask*)), this, SLOT(sltHandleMediumEnumerationTaskComplete(UITask*))); 89 87 } 90 88 91 89 UIMediumEnumerator::~UIMediumEnumerator() 92 90 { 93 /* Delete thread-pool: */94 delete m_pThreadPool;95 m_pThreadPool = 0;96 97 91 /* Delete all the tasks: */ 98 92 while (!m_tasks.isEmpty()) … … 348 342 /* Append to internal list: */ 349 343 m_tasks.append(pTask); 350 /* Post into thread-pool: */351 m_pThreadPool->enqueueTask(pTask);344 /* Post into global thread-pool: */ 345 vboxGlobal().threadPool()->enqueueTask(pTask); 352 346 } 353 347 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.h
r55401 r57611 51 51 public: 52 52 53 /* Constructor/destructor: */ 54 UIMediumEnumerator(ulong uWorkerCount = 3, ulong uWorkerTimeout = 5000); 53 /** Constructs medium-enumerator object. */ 54 UIMediumEnumerator(); 55 /** Destructs medium-enumerator object. */ 55 56 ~UIMediumEnumerator(); 56 57 … … 94 95 95 96 /* Variables: */ 96 UIThreadPool *m_pThreadPool;97 97 bool m_fMediumEnumerationInProgress; 98 98 QList<UITask*> m_tasks;
Note:
See TracChangeset
for help on using the changeset viewer.