projects
/
model-checker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
.gitignore: ignore 'benchmarks' folder
[model-checker.git]
/
main.cc
diff --git
a/main.cc
b/main.cc
index 853654ccd35626c8410842f15419b265accd2dbb..6624f0685e42c551949273feb3af9d2e0a67597a 100644
(file)
--- a/
main.cc
+++ b/
main.cc
@@
-4,9
+4,9
@@
#include <unistd.h>
#include <unistd.h>
-#include
"libthreads.h"
+#include
<threads.h>
#include "common.h"
#include "common.h"
-#include "threads.h"
+#include "threads
-model
.h"
#include "datarace.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;
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;
/** 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 */
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();
/* Wait for all threads to complete */
model->finish_execution();