- Timestamp:
- Sep 9, 2015 1:10:13 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIThreadPool.h
r57663 r57664 94 94 /** Holds the queue (FIFO) of pending tasks. */ 95 95 QQueue<UITask*> m_tasks; 96 96 /** Holds the condition variable that gets signalled when 97 97 * queuing a new task and there are idle worker threads around. 98 98 * @remarks Idle threads sits in dequeueTask waiting for this. … … 121 121 public: 122 122 123 /** Constructs worker-thread task. */ 124 UITask() {} 123 /** Task types. */ 124 enum Type 125 { 126 Type_MediumEnumeration = 1, 127 }; 128 129 /** Constructs the task of passed @a type. */ 130 UITask(UITask::Type type) : m_type(type) {} 131 132 /** Returns the type of the task. */ 133 UITask::Type type() const { return m_type; } 125 134 126 135 /** Starts the task. */ … … 132 141 * @remarks To be reimplemented in sub-class. */ 133 142 virtual void run() = 0; 143 144 private: 145 146 /** Holds the type of the task. */ 147 const UITask::Type m_type; 134 148 }; 135 149 -
trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumEnumerator.cpp
r57663 r57664 47 47 /** Constructs @a medium enumeration task. */ 48 48 UITaskMediumEnumeration(const UIMedium &medium) 49 : UITask(UITask::Type_MediumEnumeration) 49 50 { 50 51 /* Store medium as property: */ … … 273 274 { 274 275 /* Make sure that is one of our tasks: */ 276 if (pTask->type() != UITask::Type_MediumEnumeration) 277 return; 275 278 int iIndexOfTask = m_tasks.indexOf(pTask); 276 279 AssertReturnVoid(iIndexOfTask != -1);
Note:
See TracChangeset
for help on using the changeset viewer.