inspect_plugin(NULL)
{
model_print("C11Tester\n"
- "Copyright (c) 2013 and 2019 Regents of the University of California. All rights reserved.\n"
- "Distributed under the GPLv2\n"
- "Written by Weiyu Luo, Brian Norris, and Brian Demsky\n\n");
+ "Copyright (c) 2013 and 2019 Regents of the University of California. All rights reserved.\n"
+ "Distributed under the GPLv2\n"
+ "Written by Weiyu Luo, Brian Norris, and Brian Demsky\n\n");
memset(&stats,0,sizeof(struct execution_stats));
init_thread = new Thread(execution->get_next_id(), (thrd_t *) model_malloc(sizeof(thrd_t)), &placeholder, NULL, NULL);
#ifdef TLS
startExecution(get_system_context(), runChecker);
snapshot_stack_init();
snapshot_record(0);
+ initMainThread();
}
bool ModelChecker::should_terminate_execution()
execution_number = 1;
}
-void ModelChecker::startMainThread() {
- init_thread->set_state(THREAD_RUNNING);
- scheduler->set_current_thread(init_thread);
- main_thread_startup();
-}
-
/** @brief Run ModelChecker for the user program */
void ModelChecker::run()
{
model_params params;
void add_trace_analysis(TraceAnalysis *a) { trace_analyses.push_back(a); }
void set_inspect_plugin(TraceAnalysis *a) { inspect_plugin=a; }
- void startMainThread();
void startChecker();
Thread * getInitThread() {return init_thread;}
Scheduler * getScheduler() {return scheduler;}
Thread * thread_current();
void thread_startup();
-void main_thread_startup();
+void initMainThread();
static inline thread_id_t thrd_to_id(thrd_t t)
{
}
#endif
-void main_thread_startup() {
-#ifdef TLS
+void initMainThread() {
atexit(modelexit);
Thread * curr_thread = thread_current();
-
- /* Add dummy "start" action, just to create a first clock vector */
model->switch_to_master(new ModelAction(THREAD_START, std::memory_order_seq_cst, curr_thread));
-#endif
- thread_startup();
}
/**
context.uc_stack.ss_flags = 0;
context.uc_link = model->get_system_context();
#ifdef TLS
- if (model != NULL)
- makecontext(&context, setup_context, 0);
- else
- makecontext(&context, main_thread_startup, 0);
+ makecontext(&context, setup_context, 0);
#else
makecontext(&context, thread_startup, 0);
#endif