-struct xbt_thread_ {
- /* KEEP IT IN SYNC WITH xbt_os_thread (both win and lin parts) */
-#ifdef HAVE_PTHREAD_H
- pthread_t t;
- void *param;
- pvoid_f_pvoid_t *start_routine;
-#elif defined(WIN32)
- HANDLE handle; /* the win thread handle */
- unsigned long id; /* the win thread id */
- pvoid_f_pvoid_t *start_routine;
- void* param;
-#endif
-};
+xbt_thread_t xbt_thread_create(const char *name, void_f_pvoid_t code,
+ void *param, int joinable)
+{
+
+ xbt_thread_t res = xbt_new0(s_xbt_thread_t, 1);
+ res->userparam = param;
+ res->code = code;
+ DEBUG1("Create thread %p", res);
+ res->os_thread =
+ xbt_os_thread_create(name, xbt_thread_create_wrapper, res, NULL);
+ return res;
+}
+
+const char *xbt_thread_name(xbt_thread_t t)
+{
+ return xbt_os_thread_name(t->os_thread);
+}