2 * @brief Entry point for the model checker.
5 #include "libthreads.h"
11 /* global "model" object */
13 #include "snapshot-interface.h"
15 static void parse_options(struct model_params *params, int argc, char **argv) {
21 /** The real_main function contains the main model checking loop. */
22 static void real_main() {
24 ucontext_t main_context;
25 struct model_params params;
27 parse_options(¶ms, main_argc, main_argv);
29 //Initialize race detector
32 //Create the singleton SnapshotStack object
33 snapshotObject = new SnapshotStack();
35 model = new ModelChecker(params);
37 if (getcontext(&main_context))
40 model->set_system_context(&main_context);
42 snapshotObject->snapshotStep(0);
44 /* Start user program */
45 model->add_thread(new Thread(&user_thread, (void (*)(void *)) &user_main, NULL));
47 /* Wait for all threads to complete */
48 model->finish_execution();
49 } while (model->next_execution());
57 * Main function. Just initializes snapshotting library and the
58 * snapshotting library calls the real_main function.
60 int main(int argc, char ** argv) {
64 /* Let's jump in quickly and start running stuff */
65 initSnapShotLibrary(10000, 1024, 1024, 1000, &real_main);