X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=main.cc;h=6624f0685e42c551949273feb3af9d2e0a67597a;hb=a64ca6ed8ef09fb2a974d44315404075cbf365fe;hp=853654ccd35626c8410842f15419b265accd2dbb;hpb=28e1bf20ea2bc74d7376b7cd1bfce0fc409bcde9;p=model-checker.git diff --git a/main.cc b/main.cc index 853654c..6624f06 100644 --- a/main.cc +++ b/main.cc @@ -4,9 +4,9 @@ #include -#include "libthreads.h" +#include #include "common.h" -#include "threads.h" +#include "threads-model.h" #include "datarace.h" @@ -77,6 +77,12 @@ static void parse_options(struct model_params *params, int *argc, char ***argv) int main_argc; char **main_argv; +/** Wrapper to run the user's main function, with appropriate arguments */ +void wrapper_user_main(void *) +{ + user_main(main_argc, main_argv); +} + /** The model_main function contains the main model checking loop. */ static void model_main() { thrd_t user_thread; @@ -97,7 +103,7 @@ static void model_main() { snapshotObject->snapshotStep(0); do { /* Start user program */ - model->add_thread(new Thread(&user_thread, (void (*)(void *)) &user_main, NULL)); + model->add_thread(new Thread(&user_thread, &wrapper_user_main, NULL)); /* Wait for all threads to complete */ model->finish_execution();