eliminate_thread() and check_promise() have near-duplicate code, for
checking if the promise has failed. This change makes them consistent
(check_promise() now knows to eliminate its own thread immediately) and
allows one function to simply call the other.
return false;
synced_thread[id] = true;
return false;
synced_thread[id] = true;
- unsigned int sync_size = synced_thread.size();
- int promise_tid = id_to_int(read->get_tid());
- for (unsigned int i = 1; i < model->get_num_threads(); i++) {
- if ((i >= sync_size || !synced_thread[i]) && ((int)i != promise_tid) && model->is_enabled(int_to_id(i))) {
- return false;
- }
- }
- return true;
+ return check_promise();
}
bool Promise::check_promise() const
{
unsigned int sync_size = synced_thread.size();
}
bool Promise::check_promise() const
{
unsigned int sync_size = synced_thread.size();
+ int promise_tid = id_to_int(read->get_tid());
for (unsigned int i = 1; i < model->get_num_threads(); i++) {
for (unsigned int i = 1; i < model->get_num_threads(); i++) {
- if ((i >= sync_size || !synced_thread[i]) && model->is_enabled(int_to_id(i))) {
+ if ((i >= sync_size || !synced_thread[i]) && ((int)i != promise_tid) && model->is_enabled(int_to_id(i))) {