public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* RE: problem in pthread.h
@ 2006-06-05 19:17 Bossom, John
  0 siblings, 0 replies; 5+ messages in thread
From: Bossom, John @ 2006-06-05 19:17 UTC (permalink / raw)
  To: Romano Paolo Tenca; +Cc: Pthreads-Win32 list

You're welcome. 

-----Original Message-----
From: Romano Paolo Tenca [mailto:rotenca@telvia.it] 
Sent: Monday, June 05, 2006 3:17 PM
To: Bossom, John
Cc: Pthreads-Win32 list
Subject: Re: problem in pthread.h

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.
>   
Oh, now i understand! I must use the pair of push/pop macro. (RTFM)
Thank you for the help.

---
Romano Paolo Tenca
 
     This message may contain privileged and/or confidential information.  If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so.  Thank you.

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

* Re: problem in pthread.h
  2006-06-05 18:12 Bossom, John
  2006-06-05 19:08 ` Romano Paolo Tenca
@ 2006-06-05 19:16 ` Romano Paolo Tenca
  1 sibling, 0 replies; 5+ messages in thread
From: Romano Paolo Tenca @ 2006-06-05 19:16 UTC (permalink / raw)
  To: Bossom, John; +Cc: Pthreads-Win32 list

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.
>   
Oh, now i understand! I must use the pair of push/pop macro. (RTFM)
Thank you for the help.

---
Romano Paolo Tenca

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

* Re: problem in pthread.h
  2006-06-05 18:12 Bossom, John
@ 2006-06-05 19:08 ` Romano Paolo Tenca
  2006-06-05 19:16 ` Romano Paolo Tenca
  1 sibling, 0 replies; 5+ messages in thread
From: Romano Paolo Tenca @ 2006-06-05 19:08 UTC (permalink / raw)
  To: Bossom, John; +Cc: Pthreads-Win32 list

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

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

* RE: problem in pthread.h
@ 2006-06-05 18:12 Bossom, John
  2006-06-05 19:08 ` Romano Paolo Tenca
  2006-06-05 19:16 ` Romano Paolo Tenca
  0 siblings, 2 replies; 5+ messages in thread
From: Bossom, John @ 2006-06-05 18:12 UTC (permalink / raw)
  To: Romano Paolo Tenca, Pthreads-Win32 list

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.



-----Original Message-----
From: pthreads-win32-owner@sourceware.org
[mailto:pthreads-win32-owner@sourceware.org] On Behalf Of Romano Paolo
Tenca
Sent: Monday, June 05, 2006 2:06 PM
To: Pthreads-Win32 list
Subject: problem in pthread.h

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
 
     This message may contain privileged and/or confidential information.  If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate or distribute it; do not open any attachments, delete it immediately from your system and notify the sender promptly by e-mail that you have done so.  Thank you.

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

* problem in pthread.h
@ 2006-06-05 18:05 Romano Paolo Tenca
  0 siblings, 0 replies; 5+ messages in thread
From: Romano Paolo Tenca @ 2006-06-05 18:05 UTC (permalink / raw)
  To: Pthreads-Win32 list

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

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

end of thread, other threads:[~2006-06-05 19:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-05 19:17 problem in pthread.h Bossom, John
  -- strict thread matches above, loose matches on Subject: below --
2006-06-05 18:12 Bossom, John
2006-06-05 19:08 ` Romano Paolo Tenca
2006-06-05 19:16 ` Romano Paolo Tenca
2006-06-05 18:05 Romano Paolo Tenca

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).