Changeset 57626 in vbox
- Timestamp:
- Sep 4, 2015 12:46:41 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIThreadPool.cpp
r57618 r57626 34 34 35 35 36 /** 37 * COM capable worker thread for the UIThreadPool. 38 */ 36 /** QThread extension used as worker-thread. 37 * Capable of executing COM-related tasks. */ 39 38 class UIThreadWorker : public QThread 40 39 { … … 43 42 signals: 44 43 45 /* Notifier: Worker stuff:*/44 /** Notifies listeners about @a pWorker finished. */ 46 45 void sigFinished(UIThreadWorker *pWorker); 47 46 48 47 public: 49 48 50 /* Constructor: */ 49 /** Constructs worker-thread for parent worker-thread @a pPool. 50 * @param iIndex defines worker-thread index within the worker-thread pool registry. */ 51 51 UIThreadWorker(UIThreadPool *pPool, int iIndex); 52 52 53 /** Returns worker-thread index within the worker-thread pool registry. */ 53 54 int getIndex() const { return m_iIndex; } 54 55 55 /** Disables sigFinished . For optimizingpool termination. */56 /** Disables sigFinished signal, for optimizing worker-thread pool termination. */ 56 57 void setNoFinishedSignal() 57 58 { … … 61 62 private: 62 63 63 /* Helper: Worker stuff:*/64 /** Contains the worker-thread body. */ 64 65 void run(); 65 66 66 /* Variables: General stuff:*/67 /** Holds the worker-thread pool reference. */ 67 68 UIThreadPool *m_pPool; 68 69 69 /** The index into UIThreadPool::m_workers. */70 /** Holds the worker-thread index within the worker-thread pool registry. */ 70 71 int m_iIndex; 71 /** Indicates whether sigFinished should be emitted or not. */ 72 73 /** Holds whether sigFinished signal should be emitted or not. */ 72 74 bool m_fNoFinishedSignal; 73 75 }; -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIThreadPool.h
r57612 r57626 52 52 ~UIThreadPool(); 53 53 54 /** Enqueues @a pTask into t ask-queue. */54 /** Enqueues @a pTask into the task-queue. */ 55 55 void enqueueTask(UITask *pTask); 56 56 … … 62 62 protected: 63 63 64 /** Returns dequeued top-most task from the task-queue using @a pWorker as a hint.65 * @remarks Called by the worker-thread. */64 /** Returns dequeued top-most task from the task-queue. 65 * @remarks Called by the @a pWorker passed as a hint. */ 66 66 UITask* dequeueTask(UIThreadWorker *pWorker); 67 67 … … 84 84 QVector<UIThreadWorker*> m_workers; 85 85 /** Holds the number of worker-threads. 86 * @remarks We cannot use the vector size since it may contain NULLpointers. */86 * @remarks We cannot use the vector size since it may contain 0 pointers. */ 87 87 int m_cWorkers; 88 88 /** Holds the number of idle worker-threads. */ … … 114 114 }; 115 115 116 /** QObject extension used as worker-thread task .117 * Describes task to be executed by the UIThread Poolobject. */116 /** QObject extension used as worker-thread task interface. 117 * Describes task to be executed by the UIThreadWorker object. */ 118 118 class UITask : public QObject 119 119 { … … 128 128 129 129 /** Constructs worker-thread task. 130 * @param data defines inter-thread task data to be processed by worker-thread. */ 130 * @param data defines inter-thread task data to be processed 131 * by worker-thread and returned back if necessary. */ 131 132 UITask(const QVariant &data); 132 133 … … 140 141 void start(); 141 142 142 /** Contains the abstract task body, to be reimplemented in sub-class. */ 143 /** Contains the abstract task body. 144 * @remarks To be reimplemented in sub-class. */ 143 145 virtual void run() = 0; 144 146 145 147 //private: 146 148 147 /** Holds the inter-thread task data to be processed by worker-thread. */149 /** Holds the inter-thread task data. */ 148 150 QVariant m_data; 149 151
Note:
See TracChangeset
for help on using the changeset viewer.