From 8690d27f56658be9800f5dd2232f73fbe0381c1d Mon Sep 17 00:00:00 2001 From: weiyu Date: Mon, 6 Jan 2020 13:00:01 -0800 Subject: [PATCH] Bug fix for removing ATOMIC_WAIT actions --- execution.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/execution.cc b/execution.cc index 05591751..baa59171 100644 --- a/execution.cc +++ b/execution.cc @@ -1671,9 +1671,17 @@ void ModelExecution::removeAction(ModelAction *act) { } { sllnode * listref = act->getThrdMapRef(); - if (listref != NULL) { - SnapVector *vec = get_safe_ptr_vect_action(&obj_thrd_map, act->get_location()); - (*vec)[act->get_tid()].erase(listref); + if (act->is_wait()) { + if (listref != NULL) { + void *mutex_loc = (void *) act->get_value(); + SnapVector *vec = get_safe_ptr_vect_action(&obj_thrd_map, mutex_loc); + (*vec)[act->get_tid()].erase(listref); + } + } else { + if (listref != NULL) { + SnapVector *vec = get_safe_ptr_vect_action(&obj_thrd_map, act->get_location()); + (*vec)[act->get_tid()].erase(listref); + } } } if ((act->is_fence() && act->is_seqcst()) || act->is_unlock()) { -- 2.34.1