Opened 19 years ago
Closed 18 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)
by , 19 years ago
| Attachment: | mythcontext.13561.txt added |
|---|
by , 19 years ago
| Attachment: | mythcontext.13589.txt added |
|---|
comment:1 by , 18 years ago
| Milestone: | unknown → 0.21 |
|---|---|
| Owner: | changed from to |
| Version: | unknown → head |
Note:
See TracTickets
for help on using tickets.

Updated patch to simplify the loop in waitPrivEvent