This is the mail archive of the
pthreads-win32@sourceware.cygnus.com
mailing list for the pthreas-win32 project.
pthread_exit() called when a cleanup handler is installed
- To: pthreads mailing list <pthreads-win32@sourceware.cygnus.com>
- Subject: pthread_exit() called when a cleanup handler is installed
- From: Lorin Hochstein <lmh@xiphos.ca>
- Date: Tue, 06 Jul 1999 13:52:49 -0400
In my code, when calling pthread_exit(), the installed cleanup functions
do NOT execute. They do execute if I call:
pthread_cancel(pthread_self());
pthread_testcancel();
I'm using the Microsoft compiler with C code, so I end up using the
WIN32 SEH version of cancel cleanup. This uses the Microsoft __try and
__finally blocks for pthread_clean_push and pthread_cleanup_pop, and
uses _endthreadex for pthread_exit.
I'm not 100% sure, but I believe that calling _endthreadex will NOT
cause the code in a "finally" statement to be executed. A fix would
require some change to the pthread.h file (perhaps doing away with WIN32
structured exception handling altogether...?)
Lorin Hochstein