Re: Application Ending Before Secondary Thread Ends



Marshall Lake wrote:
I play audio via g_thread.  If the user quits the application before the 
thread is completed (and the user executes the application from the 
command line) the terminal needs reseting.  It's fine if the thread ends 
before the user quits the application.

I haven't tried but I expect I can avoid this behavior by doing a 
g_thread_join() and waiting for the thread to finish before exiting the 
application.  But I don't really want to do that (some of the audio is 
very long).  Are there any alternatives?

As I understand, the shell waits for the process to exit.  The only
way to achieve what you want is probably spawning another ("real")
process and terminating the current one.  On unixes you could also
fork(), but this is not portable AFAIK.

Paul



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]