Opened 16 years ago
Closed 15 years ago
#5481 closed patch (fixed)
PATCH: Occasional deadlock in Mainserver::ProcessRequestThread [SVN: Trunk]
Reported by: | Owned by: | danielk | |
---|---|---|---|
Priority: | minor | Milestone: | 0.22 |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
It seems that the mainserver.cpp uses QWaitCondition-variables without proper predicative/counter. This means that if a pthread_cond_signal() is sent before the other thread has already called QT's waitCond.wait(), the receiver will miss the signal alltogether (see http://doc.trolltech.com/4.3/qwaitcondition.html examples of using counter with waitCond.wait()).
The attached patch fixes this deadlock problem for good.
Attachments (2)
Change History (5)
Changed 16 years ago by
Attachment: | conditional.patch added |
---|
comment:1 Changed 15 years ago by
Owner: | changed from Isaac Richards to danielk |
---|---|
Status: | new → assigned |
I don't know if I will apply this patch as is, but this is definitely a bug.
comment:2 Changed 15 years ago by
Milestone: | unknown → 0.22 |
---|---|
Status: | assigned → accepted |
Changed 15 years ago by
Attachment: | 5481-v1.patch added |
---|
Updated to trunk, completely untested/unreviewed.
comment:3 Changed 15 years ago by
Resolution: | → fixed |
---|---|
Status: | accepted → closed |
(In [19511]) Fixes #5481. There is in fact no deadlock, whoever wrote this code was very careful to only issue wakes and waits so that a predicative/counter was not needed. However, there was a missing threadPoolCond.wakeXXX() call causing an uneccesary 10 ms delay in handling some requests, and just to avoid a small change mucking up the careful orchestration I've changed the wakeOne() calls to wakeAll() calls which are a little more robust (however they are NOT needed for the current code -- it's just to protect against possible changes in Qt customEvent() handling causing problems in the future.)
Fixes an occasional deadlock in Mainserver::ProcessRequestThread?