| 7268 | |
| 7269 | |
| 7270 | bool Worker::wait(int timeout) |
| 7271 | { |
| 7272 | if (m_sem.tryEnter(timeout)) |
| 7273 | return true; |
| 7274 | |
| 7275 | MutexLockGuard guard(m_mutex, FB_FUNCTION); |
| 7276 | if (m_sem.tryEnter(0)) |
| 7277 | return true; |
| 7278 | |
| 7279 | // don't exit last worker until server shutdown |
| 7280 | if ((m_cntAll - m_cntGoing == 1) && !isShuttingDown()) |
| 7281 | return true; |
| 7282 | |
| 7283 | remove(); |
| 7284 | m_going = true; |
| 7285 | m_cntGoing++; |
| 7286 | |
| 7287 | return false; |
| 7288 | } |
| 7289 | |
| 7290 | void Worker::setState(const bool active) |
| 7291 | { |
no test coverage detected