-xbt_thread_t xbt_thread_create(pvoid_f_pvoid_t start_routine, void* param) {
- THROW_UNIMPLEMENTED; /* FIXME */
+static int xbt_thread_create_wrapper(int argc, char *argv[]) {
+ xbt_thread_t t = (xbt_thread_t)SIMIX_process_get_data(SIMIX_process_self());
+ (*t->code)(t->userparam);
+ return 0;
+}
+
+xbt_thread_t xbt_thread_create(void_f_pvoid_t* code, void* param) {
+ xbt_thread_t res = xbt_new0(s_xbt_thread_t,1);
+ res->userparam = param;
+ res->code = code;
+ res->s_process = SIMIX_process_create(NULL,
+ xbt_thread_create_wrapper, res,
+ SIMIX_host_get_name(SIMIX_host_self()),
+ 0, NULL);
+ return res;