return _malloc(size);
}
- void operator delete(void *p, size_t size) {
+ void operator delete(void *p, size_t size) {
_free(p);
}
}
/** Put a key entry into the table. */
- _Val * ensureptr(_Key key) {
+ _Val * ensureptr(_Key key) {
if(size > threshold) {
//Resize
unsigned int newsize = capacity << 1;
if (diverge==NULL) {
tmp->create_cv(get_parent_action(tmp->get_tid()));
}
-
+
delete curr;
curr = tmp;
} else {
if (!parnode->backtrack_empty()||!currnode->read_from_empty()||!currnode->future_value_empty()||!currnode->promise_empty())
if (!next_backtrack || *curr > *next_backtrack)
next_backtrack = curr;
-
+
set_backtracking(curr);
}
(1) did not happen before us
(2) is a read and we are a write
(3) cannot synchronize with us
- (4) is in a different thread
+ (4) is in a different thread
=>
that read could potentially read from our write.
*/
action_list_t::reverse_iterator rit;
for (rit = list->rbegin(); rit != list->rend(); rit++) {
ModelAction *act = *rit;
-
+
/* Only consider 'write' actions */
if (!act->is_write())
continue;
ModelAction * process_rmw(ModelAction * curr);
void r_modification_order(ModelAction * curr, const ModelAction *rf);
void w_modification_order(ModelAction * curr);
-
+
ModelAction *current_action;
ModelAction *diverge;
thread_id_t nextThread;
}
/** This method sets a promise to explore meeting with the given
- * node.
+ * node.
* @param i is the promise index.
*/
return false;
}
-/** This method returns whether the promise set is empty.
+/** This method returns whether the promise set is empty.
*
* @return true if we have explored all promise combinations.
*/
return true;
}
-/**
+/**
* Checks whether the future_values set for this node is empty.
* @return true if the future_values set is empty.
*/
ModelAction * get_action() { return read; }
int increment_threads() { return ++numthreads; }
uint64_t get_value() { return value; }
-
+
private:
uint64_t value;
ModelAction *read;
}
}
-/** Create a new thread.
+/** Create a new thread.
* Takes the following parameters:
* @param t The thread identifier of the newly created thread.
* @param func The function that the thread will call.