| 169 | } |
| 170 | |
| 171 | void |
| 172 | GenericWatcher::scheduleBlockingTask(int taskID, |
| 173 | const GenericWatcherCallerArgsPtr& args) |
| 174 | { |
| 175 | { |
| 176 | QMutexLocker quitLocker(&_imp->mustQuitMutex); |
| 177 | if (_imp->mustQuit) { |
| 178 | return; |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | { |
| 183 | QMutexLocker(&_imp->tasksMutex); |
| 184 | GenericWatcherPrivate::Task t; |
| 185 | t.id = taskID; |
| 186 | t.args = args; |
| 187 | _imp->tasks.push_back(t); |
| 188 | } |
| 189 | |
| 190 | if ( !isRunning() ) { |
| 191 | start(); |
| 192 | } else { |
| 193 | ///Wake up the thread with a start request |
| 194 | QMutexLocker locker(&_imp->startRequestsMutex); |
| 195 | if (_imp->startRequests <= 0) { |
| 196 | ++_imp->startRequests; |
| 197 | } |
| 198 | _imp->startRequestsCond.wakeOne(); |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | void |
| 203 | GenericSchedulerThreadWatcher::handleBlockingTask(int taskID) |
no test coverage detected