Hello Lee,

On Sat, Jul 30, 2016 at 05:10:20PM -0700, The Lee-Man wrote:
> I looked at your suggested fix, and I think it's almost correct.
> 
> The caller should indeed have the mutex locked when calling
> pthread_cond_wait. It's probably just luck this hasn't blown up before.
> 
> But I think it just needs one tweak. You need to call
> pthread_mutex_unlock() in the error case, i.e. in the
> "rc != 0" case, before calling LOG_ERR().
> 
> Can you submit a patch or pull request updated with this
> change?

thank you very much for taking the time to look at this issue!
You're of course right about the missing "pthread_mutex_unlock()"
call in the error handling section. I've added this in the latest
Git commit and created a pull request regarding the attached patch.

Thanks & best regards,

    Frank

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.
diff --git a/iscsiuio/src/unix/nic_nl.c b/iscsiuio/src/unix/nic_nl.c
index 391003f..1a920c7 100644
--- a/iscsiuio/src/unix/nic_nl.c
+++ b/iscsiuio/src/unix/nic_nl.c
@@ -483,9 +483,11 @@ void *nl_process_handle_thread(void *arg)
 	while (!event_loop_stop) {
 		char *data = NULL;
 
+		pthread_mutex_lock(&nic->nl_process_mutex);
 		rc = pthread_cond_wait(&nic->nl_process_cond,
 				       &nic->nl_process_mutex);
 		if (rc != 0) {
+			pthread_mutex_unlock(&nic->nl_process_mutex);
 			LOG_ERR("Fatal error in NL processing thread "
 				"during wait[%s]", strerror(rc));
 			break;

Reply via email to