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 struct model_params params;
26 parse_options(¶ms, main_argc, main_argv);
28 //Initialize race detector
31 //Create the singleton SnapshotStack object
32 snapshotObject = new SnapshotStack();
34 model = new ModelChecker(params);
36 snapshotObject->snapshotStep(0);
38 /* Start user program */
39 model->add_thread(new Thread(&user_thread, (void (*)(void *)) &user_main, NULL));
41 /* Wait for all threads to complete */
42 model->finish_execution();
43 } while (model->next_execution());
51 * Main function. Just initializes snapshotting library and the
52 * snapshotting library calls the real_main function.
54 int main(int argc, char ** argv) {
58 /* Let's jump in quickly and start running stuff */
59 initSnapShotLibrary(10000, 1024, 1024, 1000, &real_main);