linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PTHREAD_CLEANUP_PUSH_DEFER_NP(3)
@ 2013-07-04 14:38 Sebastian Huber
       [not found] ` <51D588FC.6070701-L1vi/lXTdtsBbLBgBO8hYIQuADTiUCJX@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Huber @ 2013-07-04 14:38 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man-u79uwXL29TY76Z2rM5mHXA

Hello,

I think there is an error in the description

        is equivalent to (but shorter and more efficient than):

            int oldtype;

            pthread_cleanup_push(routine, arg);
            pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
            ...
            pthread_setcanceltype(oldtype, NULL);
            pthread_cleanup_pop(execute);

this should be instead

        is equivalent to (but shorter and more efficient than):

            int oldtype;

            pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
            pthread_cleanup_push(routine, arg);
            ...
            pthread_cleanup_pop(execute);
            pthread_setcanceltype(oldtype, NULL);

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber-L1vi/lXTdtsBbLBgBO8hYIQuADTiUCJX@public.gmane.org
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PTHREAD_CLEANUP_PUSH_DEFER_NP(3)
       [not found] ` <51D588FC.6070701-L1vi/lXTdtsBbLBgBO8hYIQuADTiUCJX@public.gmane.org>
@ 2013-07-09  2:34   ` Michael Kerrisk (man-pages)
       [not found]     ` <CAKgNAkimJbCdJ6W_+1qaM1KpCxFAN5EfzbMF_PDBC7vcXcb6dA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2013-07-09  2:34 UTC (permalink / raw)
  To: Sebastian Huber; +Cc: linux-man

Sebastian,

On Thu, Jul 4, 2013 at 4:38 PM, Sebastian Huber
<sebastian.huber-L1vi/lXTdtsBbLBgBO8hYIQuADTiUCJX@public.gmane.org> wrote:
> Hello,
>
> I think there is an error in the description
>
>        is equivalent to (but shorter and more efficient than):
>
>            int oldtype;
>
>            pthread_cleanup_push(routine, arg);
>            pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
>            ...
>            pthread_setcanceltype(oldtype, NULL);
>            pthread_cleanup_pop(execute);
>
> this should be instead
>
>        is equivalent to (but shorter and more efficient than):
>
>            int oldtype;
>
>            pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
>            pthread_cleanup_push(routine, arg);
>            ...
>            pthread_cleanup_pop(execute);
>            pthread_setcanceltype(oldtype, NULL);


I am doubtful of this, but, can you provide some evidence to support your claim?

Thanks,

Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PTHREAD_CLEANUP_PUSH_DEFER_NP(3)
       [not found]     ` <CAKgNAkimJbCdJ6W_+1qaM1KpCxFAN5EfzbMF_PDBC7vcXcb6dA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2013-07-09  8:07       ` Sebastian Huber
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Huber @ 2013-07-09  8:07 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w; +Cc: linux-man

Hello Michael,

On 07/09/2013 04:34 AM, Michael Kerrisk (man-pages) wrote:
> Sebastian,
>
> On Thu, Jul 4, 2013 at 4:38 PM, Sebastian Huber
> <sebastian.huber-L1vi/lXTdtsBbLBgBO8hYIQuADTiUCJX@public.gmane.org> wrote:
>> Hello,
>>
>> I think there is an error in the description
>>
>>         is equivalent to (but shorter and more efficient than):
>>
>>             int oldtype;
>>
>>             pthread_cleanup_push(routine, arg);
>>             pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
>>             ...
>>             pthread_setcanceltype(oldtype, NULL);
>>             pthread_cleanup_pop(execute);
>>
>> this should be instead
>>
>>         is equivalent to (but shorter and more efficient than):
>>
>>             int oldtype;
>>
>>             pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &oldtype);
>>             pthread_cleanup_push(routine, arg);
>>             ...
>>             pthread_cleanup_pop(execute);
>>             pthread_setcanceltype(oldtype, NULL);
>
>
> I am doubtful of this, but, can you provide some evidence to support your claim?

ok, I looked at the pthread.h of glibc and this seems to be not a man page 
problem, but a glibc bug/feature.

I thought that the pthread_cleanup_push_defer() solves the problem highlighted 
in this example:

http://www.sourceware.org/pthreads-win32/manual/pthread_cleanup_push.html

I will address this on a glibc list.  Sorry for the noise.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber-L1vi/lXTdtsBbLBgBO8hYIQuADTiUCJX@public.gmane.org
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-07-09  8:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-04 14:38 PTHREAD_CLEANUP_PUSH_DEFER_NP(3) Sebastian Huber
     [not found] ` <51D588FC.6070701-L1vi/lXTdtsBbLBgBO8hYIQuADTiUCJX@public.gmane.org>
2013-07-09  2:34   ` PTHREAD_CLEANUP_PUSH_DEFER_NP(3) Michael Kerrisk (man-pages)
     [not found]     ` <CAKgNAkimJbCdJ6W_+1qaM1KpCxFAN5EfzbMF_PDBC7vcXcb6dA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-07-09  8:07       ` PTHREAD_CLEANUP_PUSH_DEFER_NP(3) Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).