Changeset 48822 in vbox
- Timestamp:
- Oct 2, 2013 3:22:41 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIThreadPool.cpp
r48534 r48822 150 150 m_taskLocker.lock(); 151 151 152 /* Try to get task (moving it from queue to processing list): */152 /* Try to dequeue task: */ 153 153 if (!m_tasks.isEmpty()) 154 154 pTask = m_tasks.dequeue(); 155 155 156 /* If there is no task currently: */ 157 if (!pTask) 156 /* Make sure we have a task or outdated: */ 157 bool fOutdated = false; 158 while (!pTask && !fOutdated) 158 159 { 159 160 /* Mark thread as not busy: */ … … 162 163 /* Wait for <m_uIdleTimeout> milli-seconds for the next task, 163 164 * this issue will temporary unlock <m_taskLocker>: */ 164 m_taskCondition.wait(&m_taskLocker, m_uIdleTimeout);165 fOutdated = !m_taskCondition.wait(&m_taskLocker, m_uIdleTimeout); 165 166 166 167 /* Mark thread as busy again: */ 167 168 pWorker->setBusy(true); 168 169 169 /* Try to get task again (moving it from queue to processing list): */170 /* Try to dequeue task again: */ 170 171 if (!m_tasks.isEmpty()) 171 172 pTask = m_tasks.dequeue(); 172 173 } 174 Assert(pTask || fOutdated); 173 175 174 176 /* Unlock task locker: */
Note:
See TracChangeset
for help on using the changeset viewer.