| 68 | |
| 69 | |
| 70 | void MixerWorkerThread::JobQueue::run() |
| 71 | { |
| 72 | bool processedJob = true; |
| 73 | while( processedJob && (int) m_itemsDone < (int) m_writeIndex ) |
| 74 | { |
| 75 | processedJob = false; |
| 76 | for( int i = 0; i < m_writeIndex && i < JOB_QUEUE_SIZE; ++i ) |
| 77 | { |
| 78 | ThreadableJob * job = m_items[i].fetchAndStoreOrdered( NULL ); |
| 79 | if( job ) |
| 80 | { |
| 81 | job->process(); |
| 82 | processedJob = true; |
| 83 | m_itemsDone.fetchAndAddOrdered( 1 ); |
| 84 | } |
| 85 | } |
| 86 | // always exit loop if we're not in dynamic mode |
| 87 | processedJob = processedJob && ( m_opMode == Dynamic ); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | |
| 92 |
no test coverage detected