Opened 14 years ago

Closed 14 years ago

#2844 closed patch (invalid)

change LircClient to inherit & use QThread instead of pthreads

Reported by: keith@… Owned by: Isaac Richards
Priority: trivial Milestone: unknown
Component: mythtv Version: 0.20
Severity: low Keywords: Lirc LircClient
Cc: Ticket locked: no


According to the coding standards, Qt should be used for non-gui tasks, and code should be platform-independent. This patch is small and accomplishes the following:

  1. The LircClient class is changed to inherit from QThread (as well as QObject). The Process() method is basically renamed to run().
  2. The unused member pth is removed from LircClient.
  3. Static function SpawnLirc is removed from libs/libmythui/mythmainwindow.cpp and much of its body is moved to where the thread is started.
  4. A LircClient object is created on the heap. On a failure in LircClient::Init, it was not deleted. This is fixed.
  5. A few minor changes in variable names etc. that help readability.

This patch really changes no functionality. With the exception of the PTHREAD_CREATE_DETACHED flag, everything will work the same as before. This also paves the way for more interesting changes in the LircClient?, like being able to restart the client without restarting the frontend.

Attachments (1)

lirc.diff (2.6 KB) - added by keith@… 14 years ago.

Download all attachments as: .zip

Change History (2)

Changed 14 years ago by keith@…

Attachment: lirc.diff added

comment:1 Changed 14 years ago by danielk

Resolution: invalid
Status: newclosed

Discussed in mailing list. The thread's detached property is important, we don't want to leak threads.

Note: See TracTickets for help on using tickets.