qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [65/89] [abbrv] qpid-proton git commit: PROTON-1771: [c] add missing lock around wake_if_inactive
Date Tue, 03 Jul 2018 22:13:54 GMT
PROTON-1771: [c] add missing lock around wake_if_inactive

Fixes a race condition discovered by threaderciser.c


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/3e2f9b5f
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/3e2f9b5f
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/3e2f9b5f

Branch: refs/heads/go1
Commit: 3e2f9b5f8164a6720740b49b72af6471b1081df9
Parents: 8a4fac6
Author: Alan Conway <aconway@redhat.com>
Authored: Thu Apr 5 17:57:49 2018 -0400
Committer: Alan Conway <aconway@redhat.com>
Committed: Thu Apr 12 16:23:13 2018 -0400

----------------------------------------------------------------------
 c/src/proactor/epoll.c | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/3e2f9b5f/c/src/proactor/epoll.c
----------------------------------------------------------------------
diff --git a/c/src/proactor/epoll.c b/c/src/proactor/epoll.c
index 8ff5831..752e6e0 100644
--- a/c/src/proactor/epoll.c
+++ b/c/src/proactor/epoll.c
@@ -1321,7 +1321,9 @@ void pn_proactor_connect2(pn_proactor_t *p, pn_connection_t *c, pn_transport_t
*
     } else {
       psocket_gai_error(&pc->psocket, gai_error, "connect to ");
       notify = wake(&pc->context);
+      lock(&p->context.mutex);
       notify_proactor = wake_if_inactive(p);
+      unlock(&p->context.mutex);
     }
   }
   /* We need to issue INACTIVE on immediate failure */


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message