In development.
+* Fix for mutex deadlock when killing threads, patch #3564640 on SF.
+
* Make XML output well-formed, solution from patch #3575642 on SF.
Solves bug #3485651 also.
#ifndef HAVE_PTHREAD
#define pthread_mutex_lock(arg)
#define pthread_mutex_unlock(arg)
+#define pthread_cleanup_push(f,a) {
+#define pthread_cleanup_pop(e) }
#endif
/* Maximum size for one message in the message stream. */
#ifdef HAVE_PTHREAD
static pthread_mutex_t mutex_lock = PTHREAD_MUTEX_INITIALIZER;
+void ppack_cleanup( void *mutex )
+{
+ pthread_mutex_unlock(mutex);
+}
#endif
void ppack (int fdes, enum ck_msg_type type, CheckMsg *msg)
if (n > (CK_MAX_MSG_SIZE / 2))
eprintf("Message string too long", __FILE__, __LINE__ - 2);
+ pthread_cleanup_push( ppack_cleanup, &mutex_lock );
pthread_mutex_lock(&mutex_lock);
r = write (fdes, buf, n);
pthread_mutex_unlock(&mutex_lock);
+ pthread_cleanup_pop(0);
if (r == -1)
eprintf ("Error in call to write:", __FILE__, __LINE__ - 2);