1 /* xbt_sg_stubs -- empty functions sometimes used in SG (never in RL) */
3 /* This is always part of SG, never of RL. Content: */
4 /* - a bunch of stub functions of the thread related function that we need */
5 /* to add to the lib to please the linker when using ucontextes. */
6 /* - a bunch of stub functions of the java related function when we don't */
7 /* compile java bindings. */
9 /* In RL, java is useless, and threads are always part of the picture, */
12 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
13 * All rights reserved. */
15 /* This program is free software; you can redistribute it and/or modify it
16 * under the terms of the license (GNU LGPL) which comes with this package. */
18 #include "xbt_modinter.h"
19 #include "xbt/sysdep.h"
20 #include "xbt/xbt_os_thread.h"
21 #include "portable.h" /* CONTEXT_THREADS */
23 #ifndef CONTEXT_THREADS
26 /* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context.
27 * The decision (and the loading) is made in xbt/context.c.
30 int xbt_os_thread_atfork(void (*prepare)(void),
31 void (*parent)(void), void (*child)(void))
36 /* Mod_init/exit mecanism */
37 void xbt_os_thread_mod_preinit(void)
41 void xbt_os_thread_mod_postexit(void)
48 xbt_os_thread_t xbt_os_thread_create(const char *name,
49 pvoid_f_pvoid_t start_routine,
50 void *param, void *data)
52 xbt_backtrace_display_current();
54 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)");
57 void xbt_os_thread_exit(int *retcode)
59 xbt_backtrace_display_current();
61 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
64 void xbt_os_thread_detach(xbt_os_thread_t worker)
66 xbt_backtrace_display_current();
68 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
71 xbt_os_thread_t xbt_os_thread_self(void)
73 xbt_backtrace_display_current();
75 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)");
78 void xbt_os_thread_yield(void)
80 xbt_backtrace_display_current();
82 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)");
86 xbt_os_mutex_t xbt_os_mutex_init(void)
89 xbt_backtrace_display_current();
91 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)");
96 void xbt_os_mutex_acquire(xbt_os_mutex_t mutex)
99 xbt_backtrace_display_current();
101 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_acquire)");
105 void xbt_os_mutex_release(xbt_os_mutex_t mutex)
108 xbt_backtrace_display_current();
110 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_release)");
114 void xbt_os_mutex_destroy(xbt_os_mutex_t mutex)
117 xbt_backtrace_display_current();
119 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)");
123 xbt_os_cond_t xbt_os_cond_init(void)
125 xbt_backtrace_display_current();
127 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)");
130 void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex)
132 xbt_backtrace_display_current();
134 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)");
137 void xbt_os_cond_signal(xbt_os_cond_t cond)
139 xbt_backtrace_display_current();
141 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)");
144 void xbt_os_cond_broadcast(xbt_os_cond_t cond)
146 xbt_backtrace_display_current();
148 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)");
151 void xbt_os_cond_destroy(xbt_os_cond_t cond)
153 xbt_backtrace_display_current();
155 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)");