Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async方法中 AsyncTestTask::startAsyncTask 函数发送finished信号会导致阻塞。 #2

Open
xkungxfu opened this issue Nov 22, 2023 · 0 comments

Comments

@xkungxfu
Copy link

xkungxfu commented Nov 22, 2023

void AsyncTestTask::startAsyncTask() {
    _timer.start();
    QThread::sleep(2);
        _timer.stop();
        emit finished(id());
}

代码阻塞在AsyncTaskQueue::finishTask 函数。可能是QMutexLocker造成的阻塞。

AsyncTestTask::timeout() 内的_timer.stop(); emit finished(id());却可以正常执行。不会阻塞进程。

感觉很奇怪,不太好理解。
不知道作者还来不来看不看这里了,如果方便请帮忙解答一下。谢谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant