X-Git-Url: http://plrg.eecs.uci.edu/git/?p=c11tester.git;a=blobdiff_plain;f=model.cc;h=4cf5cc57fea4bb94c5998460c701a8b618264c3d;hp=c022e9e3baab9c716498992bc09e525fca61ce69;hb=7d107019dd0d32d0803fb802fc318a57101707a1;hpb=055fb927ea688ec513508b0821e331558eea40d1 diff --git a/model.cc b/model.cc index c022e9e3..4cf5cc57 100644 --- a/model.cc +++ b/model.cc @@ -135,6 +135,18 @@ Thread * ModelChecker::get_current_thread() const return scheduler->get_current_thread(); } +/** + * Must be called from user-thread context (e.g., through the global + * thread_current_id() interface) + * + * @return The id of the currently executing Thread. + */ +thread_id_t ModelChecker::get_current_thread_id() const +{ + ASSERT(int_to_id(curr_thread_num) == get_current_thread()->get_id()); + return int_to_id(curr_thread_num); +} + /** * @brief Choose the next thread to execute. *