void setTraceRef(sllnode<ModelAction *> *ref) { trace_ref = ref; }
void setThrdMapRef(sllnode<ModelAction *> *ref) { thrdmap_ref = ref; }
void setActionRef(sllnode<ModelAction *> *ref) { action_ref = ref; }
+ sllnode<ModelAction *> * getTraceRef() { return trace_ref; }
+ sllnode<ModelAction *> * getThrdMapRef() { return thrdmap_ref; }
+ sllnode<ModelAction *> * getActionRef() { return action_ref; }
SNAPSHOTALLOC
private:
const char * get_type_str() const;
return action_select_next_thread(curr);
}
+void ModelExecution::removeAction(ModelAction *act) {
+ {
+ sllnode<ModelAction *> * listref = act->getTraceRef();
+ if (listref != NULL) {
+ action_trace.erase(listref);
+ }
+ }
+ {
+ sllnode<ModelAction *> * listref = act->getThrdMapRef();
+ if (listref != NULL) {
+ SnapVector<action_list_t> *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()) {
+ sllnode<ModelAction *> * listref = act->getActionRef();
+ if (listref != NULL) {
+ action_list_t *list = get_safe_ptr_action(&obj_map, act->get_location());
+ list->erase(listref);
+ }
+ } else if (act->is_wait()) {
+ sllnode<ModelAction *> * listref = act->getActionRef();
+ if (listref != NULL) {
+ void *mutex_loc = (void *) act->get_value();
+ get_safe_ptr_action(&obj_map, mutex_loc)->erase(listref);
+ }
+ } else if (act->is_write()) {
+ sllnode<ModelAction *> * listref = act->getActionRef();
+ if (listref != NULL) {
+ SnapVector<action_list_t> *vec = get_safe_ptr_vect_action(&obj_wr_thrd_map, act->get_location());
+ (*vec)[act->get_tid()].erase(listref);
+ }
+ }
+
+}
+
Fuzzer * ModelExecution::getFuzzer() {
return fuzzer;
}
ClockVector * get_hb_from_write(ModelAction *rf) const;
ModelAction * get_uninitialized_action(ModelAction *curr) const;
ModelAction * convertNonAtomicStore(void*);
+ void removeAction(ModelAction *act);
#ifdef TLS
pthread_key_t pthreadkey;
/** The scheduler to use: tracks the running/ready Threads */
Scheduler * const scheduler;
- action_list_t action_trace;
SnapVector<Thread *> thread_map;
SnapVector<Thread *> pthread_map;
uint32_t pthread_counter;
+ action_list_t action_trace;
+
/** Per-object list of actions. Maps an object (i.e., memory location)
* to a trace of all actions performed on the object.