public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
From: Romano Paolo Tenca <rotenca@telvia.it>
To: "Bossom, John" <John.Bossom@Cognos.COM>
Cc: Pthreads-Win32 list <pthreads-win32@sources.redhat.com>
Subject: Re: problem in pthread.h
Date: Mon, 05 Jun 2006 19:08:00 -0000	[thread overview]
Message-ID: <44848113.6030409@telvia.it> (raw)
In-Reply-To: <4ABB890A1781774888DB6505E6F0E3B36E9606@sottemail2.ent.ad.cognos.com>

Bossom, John wrote:
> The pthread_cleanup_push defines a scoped block that is completed by the
> pop macro.
> This scoping is necessary in order that the internal local variable,
> _cleanup, still exists at when the pop is actually called. The pop
> expects the values in the _cleanup to still be available.
>
>   
Yes, but check the original code: the block is closed in the wrong position.
> In pthread.h  2.7.0 line 762 i find:
>
> #define pthread_cleanup_push( _rout, _arg ) \
>         { \
>             ptw32_cleanup_t     _cleanup; \
>             \
>             ptw32_push_cleanup( &_cleanup, (ptw32_cleanup_callback_t)
> (_rout), (_arg) ); \
>
> #define pthread_cleanup_pop( _execute ) \
>             (void) ptw32_pop_cleanup( _execute ); \
>         }
>
> It seems to me that it must be:
>
> #define pthread_cleanup_push( _rout, _arg ) \
>         { \
>             ptw32_cleanup_t     _cleanup; \
>             ptw32_push_cleanup( &_cleanup, (ptw32_cleanup_callback_t)
> (_rout), (_arg) ); \
>         }
>
> #define pthread_cleanup_pop( _execute ) \
>        (void) ptw32_pop_cleanup( _execute );
>
>
>   
-- 

Romano Paolo Tenca

  reply	other threads:[~2006-06-05 19:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-05 18:12 Bossom, John
2006-06-05 19:08 ` Romano Paolo Tenca [this message]
2006-06-05 19:16 ` Romano Paolo Tenca
  -- strict thread matches above, loose matches on Subject: below --
2006-06-05 19:17 Bossom, John
2006-06-05 18:05 Romano Paolo Tenca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44848113.6030409@telvia.it \
    --to=rotenca@telvia.it \
    --cc=John.Bossom@Cognos.COM \
    --cc=pthreads-win32@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).