From: Brian Norris Date: Wed, 23 Jan 2013 20:49:01 +0000 (-0800) Subject: promise: move thread_is_eliminated() X-Git-Tag: oopsla2013~336 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ac4c9ec2a1ddb227fbe88ee505f7126485b94cb9;p=model-checker.git promise: move thread_is_eliminated() Should be in the implementation file, not the header. --- diff --git a/promise.cc b/promise.cc index 3b2aa96..7f6f5e7 100644 --- a/promise.cc +++ b/promise.cc @@ -22,6 +22,20 @@ bool Promise::eliminate_thread(thread_id_t tid) return has_failed(); } +/** + * Check if a thread has already been eliminated from resolving this + * promise + * @param tid Thread ID of the thread to check + * @return True if the thread is already eliminated; false otherwise + */ +bool Promise::thread_is_eliminated(thread_id_t tid) const +{ + unsigned int id = id_to_int(tid); + if (id >= eliminated_thread.size()) + return false; + return eliminated_thread[id]; +} + /** * Check if this promise has failed. A promise can fail when all threads which * could possibly satisfy the promise have been eliminated. diff --git a/promise.h b/promise.h index 9fd6552..1f8a810 100644 --- a/promise.h +++ b/promise.h @@ -31,21 +31,7 @@ class Promise { modelclock_t get_expiration() const { return expiration; } ModelAction * get_action() const { return read; } bool eliminate_thread(thread_id_t tid); - - /** - * Check if a thread has already been eliminated from resolving this - * promise - * @param tid Thread ID of the thread to check - * @return True if the thread is already eliminated; false otherwise - */ - bool thread_is_eliminated(thread_id_t tid) const - { - unsigned int id = id_to_int(tid); - if (id >= eliminated_thread.size()) - return false; - return eliminated_thread[id]; - } - + bool thread_is_eliminated(thread_id_t tid) const; bool has_failed() const; uint64_t get_value() const { return value; } void set_write(const ModelAction *act) { write = act; }