Opened 17 years ago
Closed 17 years ago
#3553 closed patch (fixed)
Fix Synchronization in MythContext::waitPrivRequest()
Reported by: | Owned by: | Janne Grunau | |
---|---|---|---|
Priority: | minor | Milestone: | 0.21 |
Component: | mythtv | Version: | head |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
MythContext::waitPrivRequest() uses a QWaitCondition to sleep until there is a request pending. However, it does not use any locking to ensure synchronization with threads queueing requests. Without proper locking, it is possible for the caller of waitPrivRequest() to wait forever, even though there is a pending request.
The attached patch changes the following:
- Change MythContext::waitPrivRequest() to use proper locking to ensure synchronization with threads queueing requests.
- Change the QMutex, m_priv_mutex to not be declared as recursive. The QT API specifies that recursive mutexes can not be used with QWaitConditions. Also, the code that uses this mutex does not justify it being declared as recursive.
- Change the declaration of m_priv_mutex such that it is not allocated seperately on the heap. There does not appear to be any benefit of doing so.
Attachments (2)
Change History (4)
Changed 17 years ago by
Attachment: | mythcontext.13561.txt added |
---|
Changed 17 years ago by
Attachment: | mythcontext.13589.txt added |
---|
comment:1 Changed 17 years ago by
Milestone: | unknown → 0.21 |
---|---|
Owner: | changed from Isaac Richards to Janne Grunau |
Version: | unknown → head |
Note: See
TracTickets for help on using
tickets.
Updated patch to simplify the loop in waitPrivEvent