/** Wrapper to run the user's main function, with appropriate arguments */
void user_main_wrapper(void *)
{
+#ifdef TLS
+ model->get_execution()->getTLSSize();
+#endif
user_main(model->params.argc, model->params.argv);
}
{
memset(&stats,0,sizeof(struct execution_stats));
init_thread = new Thread(execution->get_next_id(), (thrd_t *) model_malloc(sizeof(thrd_t)), &user_main_wrapper, NULL, NULL); // L: user_main_wrapper passes the user program
+#ifdef TLS
+ init_thread->setTLS((char *)get_tls_addr());
+#endif
execution->add_thread(init_thread);
scheduler->set_current_thread(init_thread);
execution->setParams(¶ms);