From: Brian Norris Date: Thu, 6 Sep 2012 20:41:12 +0000 (-0700) Subject: threads: add THREAD_BLOCKED state X-Git-Tag: pldi2013~235^2^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8362b1efa92635ab49bd937edf451e3b2e0981bc;p=model-checker.git threads: add THREAD_BLOCKED state To signal that a Thread cannot yet be added back to the Scheduler's ready list. --- diff --git a/threads.h b/threads.h index 25b1d64..9396760 100644 --- a/threads.h +++ b/threads.h @@ -28,6 +28,11 @@ typedef enum thread_state { * context. */ THREAD_READY, + /** + * Thread is waiting on another action (e.g., thread completion, lock + * release, etc.) + */ + THREAD_BLOCKED, /** Thread has completed its execution */ THREAD_COMPLETED } thread_state; @@ -71,6 +76,9 @@ public: /** @return True if this thread is finished executing */ bool is_complete() { return state == THREAD_COMPLETED; } + /** @return True if this thread is blocked */ + bool is_blocked() { return state == THREAD_BLOCKED; } + /** @return True if no threads are waiting on this Thread */ bool wait_list_empty() { return wait_list.empty(); }