From: Brian Demsky Date: Sat, 3 Nov 2012 01:50:11 +0000 (-0700) Subject: fix bugs with promise check... X-Git-Tag: pldi2013~13^2~9 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=model-checker.git;a=commitdiff_plain;h=f9772fc7b25c7c632e51e0888599f0063bc40d60 fix bugs with promise check... --- diff --git a/promise.cc b/promise.cc index 5197ed3..cbd45c2 100644 --- a/promise.cc +++ b/promise.cc @@ -4,7 +4,7 @@ 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]) @@ -12,9 +12,9 @@ bool Promise::increment_threads(thread_id_t tid) { synced_thread[id]=true; 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] == THREAD_ENABLED)) + if ((i >= sync_size || !synced_thread[i]) && (enabled[i] != THREAD_DISABLED)) return false; } return true;