This is the mail archive of the
pthreads-win32@sourceware.org
mailing list for the pthreas-win32 project.
RE: problem in pthread.h
- From: "Bossom, John" <John dot Bossom at Cognos dot COM>
- To: "Romano Paolo Tenca" <rotenca at telvia dot it>, "Pthreads-Win32 list" <pthreads-win32 at sources dot redhat dot com>
- Date: Mon, 5 Jun 2006 14:12:06 -0400
- Subject: RE: problem in pthread.h
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.