| 160 | } |
| 161 | |
| 162 | void |
| 163 | GenericWatcher::scheduleBlockingTask(int taskID, |
| 164 | const boost::shared_ptr<GenericWatcherCallerArgs>& args) |
| 165 | { |
| 166 | { |
| 167 | QMutexLocker quitLocker(&_imp->mustQuitMutex); |
| 168 | if (_imp->mustQuit) { |
| 169 | return; |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | { |
| 174 | QMutexLocker(&_imp->tasksMutex); |
| 175 | GenericWatcherPrivate::Task t; |
| 176 | t.id = taskID; |
| 177 | t.args = args; |
| 178 | _imp->tasks.push_back(t); |
| 179 | } |
| 180 | |
| 181 | if ( !isRunning() ) { |
| 182 | start(); |
| 183 | } else { |
| 184 | ///Wake up the thread with a start request |
| 185 | QMutexLocker locker(&_imp->startRequestsMutex); |
| 186 | if (_imp->startRequests <= 0) { |
| 187 | ++_imp->startRequests; |
| 188 | } |
| 189 | _imp->startRequestsCond.wakeOne(); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | void |
| 194 | GenericSchedulerThreadWatcher::handleBlockingTask(int taskID) |
no test coverage detected