gpt4 book ai didi

multithreading - QMutex::lock:在线程0xfe8(主线程?)中检测到死锁

转载 作者:行者123 更新时间:2023-12-03 13:13:41 25 4
gpt4 key购买 nike

我正在GDB中运行我的程序。我的程序需要为其工作创建16个线程。所有这些都很好。最后我得到了错误QMutex::lock: Deadlock detected in thread 0xfe8这是GDB输出

(gdb) run
Starting program: C:\dgrfb.run\client/DGRFB.exe
[New thread 4076.0xfe8]
[New thread 4076.0x368]
warning: >> Socket State Changed: QAbstractSocket::HostLookupState
warning: >> Socket State Changed: QAbstractSocket::ConnectingState
[New thread 4076.0x4b8]
warning: >> Socket State Changed: QAbstractSocket::ConnectedState
[New thread 4076.0x49c]
warning: Rect Area 0 2 DG::UpdateThread(0xa0d5220)
warning: Rect Area 0 3 DG::UpdateThread(0xa0d5548)
warning: Rect Area 1 0 DG::UpdateThread(0xa0d5870)
warning: Rect Area 1 1 DG::UpdateThread(0xa0d5b98)
warning: Rect Area 1 2 DG::UpdateThread(0xa0d5ec0)
warning: Rect Area 1 3 DG::UpdateThread(0xa0d61e8)
warning: Rect Area 2 0 DG::UpdateThread(0xa0d6510)
warning: Rect Area 2 1 DG::UpdateThread(0xa0d6838)
warning: Rect Area 2 2 DG::UpdateThread(0xa0d6b60)
warning: Rect Area 2 3 DG::UpdateThread(0xa0d6e88)
[New thread 4076.0x540]
warning: Rect Area 3 0 DG::UpdateThread(0xa0d71b0)
warning: Rect Area 3 1 DG::UpdateThread(0xa0d7568)
warning: Rect Area 3 2 DG::UpdateThread(0xa0d7cc0)
warning: Rect Area 3 3 DG::UpdateThread(0xa0d7fe8)
[New thread 4076.0x670]
[New thread 4076.0x6dc]
[New thread 4076.0x674]
[New thread 4076.0x3ac]
[New thread 4076.0x684]
[New thread 4076.0x434]
[New thread 4076.0x44c]
[New thread 4076.0x7e8]
[New thread 4076.0x408]
[New thread 4076.0x7e0]
[New thread 4076.0x42c]
[New thread 4076.0x814]
[New thread 4076.0x6f8]
[New thread 4076.0x8a4]
warning: QThread(0x3d58d8) tick
warning: Rect # 0 0 100 56
warning: Unmatched true
warning: Updating 0 0
warning: QMutex::lock: Deadlock detected in thread 0xfe8

现在,哪个线程 0xfe8是?是主线程吗?
首先,我认为我已经两次调用了相同的 mutex.lock()。或 func_a()func_b()使用相同的互斥量。多数民众赞成在造成僵局。但是没有找到任何这样的情况。那么,为什么要开始调查呢?

最佳答案

很难回答哪个线程导致了死锁。但是,根据经验,请尝试使用QMutexLocker尽可能避免死锁。这样,您的文本将自动解锁。

关于multithreading - QMutex::lock:在线程0xfe8(主线程?)中检测到死锁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5814185/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com