| 53 | } |
| 54 | |
| 55 | bool append(Task task) { |
| 56 | if (!m_init_ok){ |
| 57 | QCERR_AND_THROW(run_fail, "Error: Failed to append task, please initialize the threadPool first."); |
| 58 | } |
| 59 | |
| 60 | m_queue_mutex.lock(); |
| 61 | m_tasks_queue.push(task); |
| 62 | m_queue_mutex.unlock(); |
| 63 | |
| 64 | m_condition.notify_all(); |
| 65 | return true; |
| 66 | } |
| 67 | |
| 68 | private: |
| 69 | void run() { |
no test coverage detected