changeset 3133:005959102811

neon: avoid deadlocks in NEON_STATUS_ERROR codepath.
author William Pitcock <nenolod@atheme.org>
date Thu, 07 May 2009 00:36:39 -0500
parents f8686c591e49
children 354e90c81253
files src/neon/neon.c
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/neon/neon.c	Thu May 07 00:30:11 2009 -0500
+++ b/src/neon/neon.c	Thu May 07 00:36:39 2009 -0500
@@ -1050,10 +1050,13 @@
                  */
                 _DEBUG("<%p> NEON_READER_ERROR happened. Terminating reader thread and marking EOF.", h);
                 h->reader_status.status = NEON_READER_EOF;
+                g_mutex_unlock(h->reader_status.mutex);
 
                 if (NULL != h->reader)
                     kill_reader(h);
 
+                g_mutex_lock(h->reader_status.mutex);
+
             case NEON_READER_EOF:
                 /*
                  * If there still is data in the buffer, carry on.