Because we now only consider a subset of threads for satisfying
promises, we can have a disabled thread that still may satisfy a
promise; it could simply synchronize with another unrelated thread, then
continue to generate a write that can resolve the promise.
As a side effect, this change makes "has_failed()" much simpler.
*/
bool Promise::has_failed() const
{
- for (unsigned int i = 0; i < available_thread.size(); i++) {
- thread_id_t tid = int_to_id(i);
- if (thread_is_available(tid) && model->is_enabled(tid))
- return false;
- }
- ASSERT(num_available_threads == 0);
- return true;
+ return num_available_threads == 0;
}