6 * Eliminate a thread which no longer can satisfy this promise. Once all
7 * enabled threads have been eliminated, this promise is unresolvable.
9 * @param tid The thread ID of the thread to eliminate
10 * @return True, if this elimination has invalidated the promise; false
13 bool Promise::eliminate_thread(thread_id_t tid)
15 unsigned int id = id_to_int(tid);
16 if (id >= eliminated_thread.size())
17 eliminated_thread.resize(id + 1, false);
18 if (eliminated_thread[id])
21 eliminated_thread[id] = true;
26 * Check if a thread has already been eliminated from resolving this
28 * @param tid Thread ID of the thread to check
29 * @return True if the thread is already eliminated; false otherwise
31 bool Promise::thread_is_eliminated(thread_id_t tid) const
33 unsigned int id = id_to_int(tid);
34 if (id >= eliminated_thread.size())
36 return eliminated_thread[id];
40 * Check if this promise has failed. A promise can fail when all threads which
41 * could possibly satisfy the promise have been eliminated.
43 * @return True, if this promise has failed; false otherwise
45 bool Promise::has_failed() const
47 for (unsigned int i = 1; i < model->get_num_threads(); i++) {
48 thread_id_t tid = int_to_id(i);
49 if (!thread_is_eliminated(tid) && model->is_enabled(tid))