This is the mail archive of the
pthreads-win32@sourceware.org
mailing list for the pthreas-win32 project.
Re: pthread_cond_destroy and cancel
- From: Romano Paolo Tenca <rotenca at telvia dot it>
- To: Pthreads-Win32 list <pthreads-win32 at sources dot redhat dot com>
- Date: Tue, 13 Jun 2006 12:25:49 +0200
- Subject: Re: pthread_cond_destroy and cancel
- References: <448D5D96.4070902@telvia.it>
The problem with the code is that pthread_cond_destroy() is a
cancellation point, because it can call sem_wait().
A weak workaround is to call
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE,NULL);
before pthread_cond_destroy()
BTW, pthread_cond_destroy is not in the list of cancellation points
(pthread_cancel.html).
I think that a destroy function should not be a cancellation point, else
cleanup routine can easy deadlock itself.
--
Romano Paolo Tenca