[LC++]Question on pthreads

David Brodrick David.Brodrick at csiro.au
Thu Jul 15 07:13:02 UTC 2004


> hits enter. Now I want the program to terminate if a
> something unexpected in the thread spawned. How
> exactly do I go about doing this?

I'm not sure about signalling the unexpected condition to the main
thread, since your main thread is blocked waiting for user input and
cannot call pthread_join.

However I think the spawned thread can close the application (if the
unexpected condition occurs) just by calling exit(1).

Regards,
  Dave





More information about the tuxCPProgramming mailing list