}
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;
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:
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());
}
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 */
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())
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();
}
#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);
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);