/* xbt_os_thread_join frees the joined thread (ie the XBT wrapper around it, the OS frees the rest) */
XBT_PUBLIC(void) xbt_os_thread_join(xbt_os_thread_t thread,void ** thread_return);
XBT_PUBLIC(void) xbt_os_thread_yield(void);
+ XBT_PUBLIC(void*) xbt_os_thread_getparam(void);
/** \brief Thread mutex data type (opaque structure) */
#include <pthread.h>
typedef struct xbt_os_thread_ {
- /* KEEP IT IN SYNC WITH xbt_thread.c */
pthread_t t;
void *param;
pvoid_f_pvoid_t *start_routine;
free(cond);
}
+void *xbt_os_thread_getparam(void) {
+ xbt_os_thread_t t = xbt_os_thread_self();
+ return t->param;
+}
+
/* ********************************* WINDOWS IMPLEMENTATION ************************************ */
#elif defined(WIN32)
typedef struct xbt_os_thread_ {
- /* KEEP IT IN SYNC WITH xbt_thread */
HANDLE handle; /* the win thread handle */
unsigned long id; /* the win thread id */
pvoid_f_pvoid_t *start_routine;
return TlsGetValue(xbt_self_thread_key);
}
+void *xbt_os_thread_getparam(void) {
+ xbt_os_thread_t t = xbt_os_thread_self();
+ return t->param;
+}
+
+
void xbt_os_thread_yield(void) {
Sleep(0);
}