X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=promise.cc;h=cbd45c2ffcf96f5398c49b29c4fdc2ef169c9b61;hb=11270ed797bd19f432589cdc7b01688ef924dd34;hp=259ba058ddba82bbd8eaeb0b8559a24144cd087e;hpb=c832cb55af09e735821ae3463bc37c29d3fa27c8;p=model-checker.git diff --git a/promise.cc b/promise.cc index 259ba05..cbd45c2 100644 --- a/promise.cc +++ b/promise.cc @@ -4,17 +4,17 @@ bool Promise::increment_threads(thread_id_t tid) { unsigned int id=id_to_int(tid); - if (id>=synced_thread.size()) { + if ( id >= synced_thread.size() ) { synced_thread.resize(id+1, false); } if (synced_thread[id]) return false; synced_thread[id]=true; - bool * enabled=model->get_scheduler()->get_enabled(); - + enabled_type_t * enabled=model->get_scheduler()->get_enabled(); + unsigned int sync_size=synced_thread.size(); for(unsigned int i=0;iget_num_threads();i++) { - if (!synced_thread[id] && enabled[id]) + if ((i >= sync_size || !synced_thread[i]) && (enabled[i] != THREAD_DISABLED)) return false; } return true;