On Wed, 21 Jan 2004, Paweł Sikora wrote:

> makro
>
>     CLEANUP_HANDLER(sigchld_cancel, &pid, &oldtype);
>
> jest rozwijane przez cos takiego
>
> #define       CLEANUP_RESET(__execute, __oldtype) \
>     (void) pthread_cleanup_pop(__execute); \
>     (void) pthread_setcanceltype ((__oldtype), &(__oldtype));
>
> w cos takiego
>
>     (void) pthread_setcanceltype (PTHREAD_CANCEL_ASYNCHRONOUS, (&oldtype));
>     do {
>       __pthread_unwind_buf_t __cancel_buf;
>       void (*__cancel_routine) (void *) = ((sigchld_cancel));
>       void *__cancel_arg = ((&pid));
>       int not_first_call = __sigsetjmp ((struct __jmp_buf_tag *) 
> __cancel_buf.__cancel_jmp_buf, 0);
>       if (__builtin_expect (not_first_call, 0))
>       {
>           __cancel_routine (__cancel_arg);
>           __pthread_unwind_next (&__cancel_buf);
>       }
>       __pthread_register_cancel (&__cancel_buf);
>     do {;;

stoj, wrrrooc, to nie to mi sie wkleilo, ale ten fragment tez ciekawie
nie wyglada. zwlaszcza to do{;;.
cos mi sie wydaje, ze pthread.h jest lekko przedobrzony.

__________________________________________________________
nie pytaj co inni zrobili dla pld, pomysl ile sam zrobiles

Odpowiedź listem elektroniczym