bug fix
authorroot <root@dw-6.eecs.uci.edu>
Mon, 29 Jul 2019 04:07:16 +0000 (21:07 -0700)
committerroot <root@dw-6.eecs.uci.edu>
Mon, 29 Jul 2019 04:07:16 +0000 (21:07 -0700)
cyclegraph.cc
execution.cc
history.cc
threads.cc

index 7cfd21c..966a503 100644 (file)
@@ -138,7 +138,7 @@ void CycleGraph::addRMWEdge(const ModelAction *from, const ModelAction *rmw)
 }
 
 void CycleGraph::addEdges(SnapList<ModelAction *> * edgeset, const ModelAction *to) {
-  for(SnapList<ModelAction*>::iterator it = edgeset->begin();it!=edgeset->end();) {
+       for(SnapList<ModelAction*>::iterator it = edgeset->begin();it!=edgeset->end();) {
                ModelAction *act = *it;
                CycleNode *node = getNode(act);
                SnapList<ModelAction*>::iterator it2 = it;
@@ -147,11 +147,11 @@ void CycleGraph::addEdges(SnapList<ModelAction *> * edgeset, const ModelAction *
                        ModelAction *act2 = *it2;
                        CycleNode *node2 = getNode(act2);
                        if (checkReachable(node, node2)) {
-                         it = edgeset->erase(it);
-                         goto endouterloop;
+                               it = edgeset->erase(it);
+                               goto endouterloop;
                        } else if (checkReachable(node2, node)) {
-                         it2 = edgeset->erase(it2);
-                         goto endinnerloop;
+                               it2 = edgeset->erase(it2);
+                               goto endinnerloop;
                        }
                        it2++;
 endinnerloop:
@@ -160,8 +160,8 @@ endinnerloop:
                it++;
 endouterloop:
                ;
-  }
-  for(SnapList<ModelAction*>::iterator it = edgeset->begin();it!=edgeset->end();it++) {
+       }
+       for(SnapList<ModelAction*>::iterator it = edgeset->begin();it!=edgeset->end();it++) {
                ModelAction *from = *it;
                addEdge(from, to, from->get_tid() == to->get_tid());
        }
index c07db8e..290a262 100644 (file)
@@ -919,6 +919,8 @@ void ModelExecution::w_modification_order(ModelAction *curr)
                if (last_seq_cst != NULL) {
                        edgeset.push_back(last_seq_cst);
                }
+               //update map for next query
+               obj_last_sc_map.put(curr->get_location(), curr);
        }
 
        /* Last SC fence in the current thread */
@@ -1207,10 +1209,6 @@ void ModelExecution::add_normal_write_to_lists(ModelAction *act)
 
 
 void ModelExecution::add_write_to_lists(ModelAction *write) {
-       // Update seq_cst map
-       if (write->is_seqcst())
-               obj_last_sc_map.put(write->get_location(), write);
-
        SnapVector<action_list_t> *vec = get_safe_ptr_vect_action(&obj_wr_thrd_map, write->get_location());
        int tid = id_to_int(write->get_tid());
        if (tid >= (int)vec->size())
index 4c0c4f5..ca176b1 100644 (file)
@@ -126,8 +126,8 @@ void ModelHistory::process_action(ModelAction *act, thread_id_t tid)
        if (inst == NULL)
                return;
 
-       if (inst->is_read())
-               func_node->store_read(act, tid);
+       //      if (inst->is_read())
+       //      func_node->store_read(act, tid);
 
        /* add to curr_inst_list */
        func_inst_list_t * curr_inst_list = func_inst_lists->back();
index cb814fc..8b3e0c6 100644 (file)
@@ -93,7 +93,7 @@ void thread_startup()
 }
 
 #ifdef TLS
-static int (*pthread_mutex_init_p) (pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) = NULL;
+static int (*pthread_mutex_init_p)(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) = NULL;
 
 int real_pthread_mutex_init(pthread_mutex_t *__mutex, const pthread_mutexattr_t *__mutexattr) {
        return pthread_mutex_init_p(__mutex, __mutexattr);
@@ -207,7 +207,7 @@ void setup_context() {
        model->switch_to_master(new ModelAction(THREAD_START, std::memory_order_seq_cst, curr_thread));
 
        real_init_all();
-       
+
        /* Initialize our lock */
        real_pthread_mutex_init(&curr_thread->mutex, NULL);
        real_pthread_mutex_init(&curr_thread->mutex2, NULL);