{
model = malloc(sizeof(*model));
memset(model, 0, sizeof(*model));
+
+ /* First thread created (system_thread) will have index 1 */
+ model->used_thread_id = 0;
+
scheduler_init(model);
}
free(sched);
free(model);
}
+
+void model_checker_assign_id(struct thread *t)
+{
+ t->index = ++model->used_thread_id;
+}
struct model_checker {
struct scheduler *scheduler;
struct thread *system_thread;
+
+ /* "Private" fields */
+ int used_thread_id;
};
extern struct model_checker *model;
void model_checker_init(void);
void model_checker_add_system_thread(struct thread *t);
+void model_checker_assign_id(struct thread *t);
#endif /* __MODEL_H__ */