Re: test_select for(;;) question

2004-09-12 Thread Ralf S. Engelschall
On Sun, Feb 08, 2004, whoosh777 wrote:

> another Pth-2.0.0 test_select question:
>
> in test_select.c, in main(),
>
> I dont see how the program can ever reach
> the code following the for(;;) loop,
>
> ie am I being naive or is it impossible for
> the code to reach:
>
> pth_cancel(t_ticker);
> pth_join(t_ticker, NULL);
> pth_event_free(evt, PTH_FREE_THIS);
> pth_kill();
> return 0;
> }
>
> if it is impossible, then what is the
> purpose of these statements?

Yes, you are right. The program directly exit(3)s or is terminated by
SIGINTR. So the code is not reached. The more complete example would be
to catch SIGINTR in the loop and "break" out of the loop.

   Ralf S. Engelschall
   [EMAIL PROTECTED]
   www.engelschall.com

__
GNU Portable Threads (Pth)http://www.gnu.org/software/pth/
Development Site  http://www.ossp.org/pkg/lib/pth/
Distribution Files  ftp://ftp.gnu.org/gnu/pth/
Distribution Snapshots ftp://ftp.ossp.org/pkg/lib/pth/
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager (Majordomo)   [EMAIL PROTECTED]


test_select for(;;) question

2004-02-08 Thread whoosh777

Hello,

another Pth-2.0.0 test_select question:

in test_select.c, in main(),

I dont see how the program can ever reach 
the code following the for(;;) loop,

ie am I being naive or is it impossible for 
the code to reach:

pth_cancel(t_ticker);
pth_join(t_ticker, NULL);
pth_event_free(evt, PTH_FREE_THIS);
pth_kill();
return 0;
}

if it is impossible, then what is the 
purpose of these statements?


__
GNU Portable Threads (Pth)http://www.gnu.org/software/pth/
Development Site  http://www.ossp.org/pkg/lib/pth/
Distribution Files  ftp://ftp.gnu.org/gnu/pth/
Distribution Snapshots ftp://ftp.ossp.org/pkg/lib/pth/
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager (Majordomo)   [EMAIL PROTECTED]