GDB에서 프로그램을 실행하고 있습니다. 내 프로그램은 작업을 위해 16 개의 스레드를 만들어야합니다. 이 모든 것들이 잘 작동합니다. 마지막에 나는 오류 여기 QMutex::lock: Deadlock detected in thread 0xfe8
QMutex :: lock : 스레드 0xfe8 (주 스레드)에서 교착 상태가 감지되었습니다.
(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
인 GDB 출력은 얻을? 그것은 주요 실입니까? 처음에 나는 같은 것을
mutex.lock()
이라고 두 번 생각했다. 또는
func_a()
및
func_b()
은 같은 뮤텍스를 사용하고 있습니다. 교착 상태의 원인. 그런 시나리오는 없었어요. 조사 시작을위한 휠라?
나는 대부분의 장소에서'QMutexLocker'를 사용하고 있습니다. 그리고 첫 번째 라인에서 gdb 출력'[New thread 4076.0xfe8]'(위 참조)과 마지막에'QMutex :: lock : 스레드 0xfe8에서 교착 상태 감지 됨 '을 자세히 살펴 보겠습니다. 주 스레드가 교착 상태에 있다는 것을 의미합니까? 내가 왜'0xfe8'에 어떤 단서에 초점을 맞추고 있는지 명확히 할 수 있기를 희망 하는가? 이 출력 0xfe8에 따라 –
이 생성 된 첫 번째 스레드입니다. 그래, 교착 상태를 감지 한 GUI 스레드 (주 스레드) –
경고 : QThread (0x3d58d8) tick 부분은 다른 스레드가 실행되어 메인 스레드가 필요로하는 것을 잠근 것을 의미합니다. 이 시점에서 주 스레드 블록과 교착 상태가 발생합니다.이 결과에서이 부분을 이해할 수 있습니다. –