Ensure that the 'current' thread reference is removed properly.
return 0;
}
+void ModelChecker::remove_thread(Thread *t)
+{
+ scheduler->remove_thread(t);
+}
+
int ModelChecker::switch_to_master(ModelAction *act)
{
Thread *old, *next;
Thread * schedule_next_thread();
int add_thread(Thread *t);
+ void remove_thread(Thread *t);
Thread * get_thread(thread_id_t tid) { return thread_map[tid]; }
int get_next_id();
readyList.push_back(t);
}
+void Scheduler::remove_thread(Thread *t)
+{
+ if (current == t)
+ current = NULL;
+ else
+ readyList.remove(t);
+}
+
Thread * Scheduler::next_thread(void)
{
Thread *t = model->schedule_next_thread();
class Scheduler {
public:
void add_thread(Thread *t);
+ void remove_thread(Thread *t);
Thread * next_thread(void);
Thread * get_current_thread(void);
void print();