This is the mail archive of the pthreads-win32@sourceware.cygnus.com mailing list for the pthreas-win32 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

pthread_exit() called when a cleanup handler is installed


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]