This is an automated email from the ASF dual-hosted git repository.

cliffjansen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/master by this push:
     new ff8ca1a  PROTON-2337: epoll proactor - missing lock on variable 
increment, found by TSAN
ff8ca1a is described below

commit ff8ca1a0c96cbabf99a79e248610a03ddf016262
Author: Cliff Jansen <cliffjan...@apache.org>
AuthorDate: Thu Feb 18 22:19:58 2021 -0800

    PROTON-2337: epoll proactor - missing lock on variable increment, found by 
TSAN
---
 c/src/proactor/epoll.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/c/src/proactor/epoll.c b/c/src/proactor/epoll.c
index 8c792e6..876c55a 100644
--- a/c/src/proactor/epoll.c
+++ b/c/src/proactor/epoll.c
@@ -2407,12 +2407,12 @@ static pn_event_batch_t 
*next_event_batch(pn_proactor_t* p, bool can_block) {
   lock(&p->tslot_mutex);
   tslot_t * ts = find_tslot(p);
   unlock(&p->tslot_mutex);
-  ts->generation++;  // wrapping OK.  Just looking for any change
 
   lock(&p->sched_mutex);
   assert(ts->task == NULL || ts->earmarked);
   assert(ts->state == UNUSED || ts->state == NEW);
   ts->state = PROCESSING;
+  ts->generation++;  // wrapping OK.  Just looking for any change
 
   // Process outstanding epoll events until we get a batch or need to block.
   while (true) {


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

Reply via email to