X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/e0702d63ff71a32f733f7c1044b008ca60777e9b..58a279d8ca32bc6c9ff69d16d7e2ac815f80db2c:/src/xbt/xbt_sg_stubs.c diff --git a/src/xbt/xbt_sg_stubs.c b/src/xbt/xbt_sg_stubs.c index 6a86c13a9c..dccc2355cb 100644 --- a/src/xbt/xbt_sg_stubs.c +++ b/src/xbt/xbt_sg_stubs.c @@ -21,11 +21,18 @@ #include "portable.h" /* CONTEXT_THREADS */ #ifndef CONTEXT_THREADS - +#ifndef WIN32 +#ifdef HAVE_PTHREAD_H /* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context. * The decision (and the loading) is made in xbt/context.c. */ +int xbt_os_thread_atfork(void (*prepare)(void), + void (*parent)(void), void (*child)(void)) +{ + return 0; +} + /* Mod_init/exit mecanism */ void xbt_os_thread_mod_preinit(void) { @@ -40,95 +47,113 @@ void xbt_os_thread_mod_postexit(void) xbt_os_thread_t xbt_os_thread_create(const char *name, pvoid_f_pvoid_t start_routine, - void *param) + void *param, void *data) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)"); } void xbt_os_thread_exit(int *retcode) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)"); +} + +void xbt_os_thread_detach(xbt_os_thread_t worker) +{ + xbt_backtrace_display_current(); + xbt_die + ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)"); } xbt_os_thread_t xbt_os_thread_self(void) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)"); } void xbt_os_thread_yield(void) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)"); } xbt_os_mutex_t xbt_os_mutex_init(void) { - xbt_backtrace_display_current(); - xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)"); + /* + xbt_backtrace_display_current(); + xbt_die + ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)"); + */ + return NULL; } void xbt_os_mutex_acquire(xbt_os_mutex_t mutex) { - xbt_backtrace_display_current(); - xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_acquire)"); + /* + xbt_backtrace_display_current(); + xbt_die + ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_acquire)"); + */ } void xbt_os_mutex_release(xbt_os_mutex_t mutex) { - xbt_backtrace_display_current(); - xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_release)"); + /* + xbt_backtrace_display_current(); + xbt_die + ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_release)"); + */ } void xbt_os_mutex_destroy(xbt_os_mutex_t mutex) { - xbt_backtrace_display_current(); - xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)"); + /* + xbt_backtrace_display_current(); + xbt_die + ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)"); + */ } xbt_os_cond_t xbt_os_cond_init(void) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)"); } void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)"); } void xbt_os_cond_signal(xbt_os_cond_t cond) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)"); } void xbt_os_cond_broadcast(xbt_os_cond_t cond) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)"); } void xbt_os_cond_destroy(xbt_os_cond_t cond) { xbt_backtrace_display_current(); xbt_die - ("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)"); + ("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)"); } #endif +#endif +#endif