static int swap(Thread *t, ucontext_t *ctxt);
thread_state get_state() const { return state; }
- void set_state(thread_state s) { state = s; }
+ void set_state(thread_state s);
thread_id_t get_id() const;
thrd_t get_thrd_t() const { return *user_thread; }
Thread * get_parent() const { return parent; }
{
return id;
}
+
+/**
+ * Set a thread's THREAD_* state (@see thread_state)
+ * @param s The state to enter
+ */
+void Thread::set_state(thread_state s)
+{
+ ASSERT(s == THREAD_COMPLETED || state != THREAD_COMPLETED);
+ state = s;
+}