| 20078 | } |
| 20079 | |
| 20080 | void QKeyMapper_Worker::resetGlobalSendInputTaskController() |
| 20081 | { |
| 20082 | SendInputTaskController &controller = SendInputTask::s_GlobalSendInputTaskController; |
| 20083 | controller.task_threadpool->clear(); |
| 20084 | controller.task_stop_condition->wakeAll(); |
| 20085 | if (controller.task_stop_mutex->try_lock_for(std::chrono::milliseconds(TRY_LOCK_WAIT_TIME))) { |
| 20086 | controller.task_stop_mutex->unlock(); |
| 20087 | } |
| 20088 | else { |
| 20089 | #ifdef DEBUG_LOGOUT_ON |
| 20090 | qDebug().nospace().noquote() << "\033[1;34m[resetGlobalSendInputTaskController] Try lock wait failed!!!\033[0m"; |
| 20091 | #endif |
| 20092 | } |
| 20093 | *controller.task_stop_flag = INPUTSTOP_NONE; |
| 20094 | *controller.task_pause_state = KEYSEQUENCE_PAUSE_STATE_NONE; |
| 20095 | controller.task_threadpool->waitForDone(100); |
| 20096 | |
| 20097 | #ifdef DEBUG_LOGOUT_ON |
| 20098 | qDebug().nospace().noquote() << "\033[1;34m[resetGlobalSendInputTaskController] Reset Global SendInputTask controllers finished.\033[0m"; |
| 20099 | #endif |
| 20100 | } |
| 20101 | |
| 20102 | void QKeyMapper_Worker::clearGlobalSendInputTaskController() |
| 20103 | { |