[linux-audio-dev] Daemon mode

Lars Luthman lars.luthman at gmail.com
Sat Dec 16 11:14:03 UTC 2006

On Sat, 2006-12-16 at 17:56 +0700, Patrick Shirkey wrote:
> Hi,
> I am adding a Daemon mode to jackEQ and have most of the code in place now.
> I am stuck at the point where the daemon starts up and keeps going.
> Essentially I need the daemon mode equivalent of gtk_main() that keeps 
> ticking over until the app is told to stop or otherwise shutdown.
> I have not threaded the app at this point so hopefully there is a very 
> simple solution.

So the only thread that needs to do anything is the JACK thread? In that
case you can just add something like 

 ... init code ...
 bool run = true;
 while (run) sleep(10000);

 ... cleanup code ...

in the main thread, after setting up JACK. If you want to be nice you
can add signal handlers for SIGHUP and SIGINT that set 'run' to false.

Lars Luthman - please encrypt any email sent to me if possible
PGP key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x04C77E2E
Fingerprint: FCA7 C790 19B9 322D EB7A E1B3 4371 4650 04C7 7E2E
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20061216/1f05f0d7/attachment.pgp>

More information about the Linux-audio-dev mailing list