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 7cfd21c87ef1168f86d059d0b19a5054bf7487a4..966a5035a9fd484074b2a6802bff58cc119e58ae 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 c07db8e9a7d21a555c789a3053c6bcb2b3846491..290a2624666f905dc8bac06c5178aafc2fe5dda0 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 4c0c4f52d9f05235281a8c961f074c71fb5c46cf..ca176b1900759e71ec8b8c25aa2c979749c88f1a 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 cb814fc5e233599461b8573f5680087c53119655..8b3e0c6191ae7c9333c11fcafff83570819c4863 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);