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 /* Mod_init/exit mecanism */
31 void xbt_os_thread_mod_preinit(void)
35 void xbt_os_thread_mod_postexit(void)
42 xbt_os_thread_t xbt_os_thread_create(const char *name,
43 pvoid_f_pvoid_t start_routine,
46 xbt_backtrace_display_current();
48 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)");
51 void xbt_os_thread_exit(int *retcode)
53 xbt_backtrace_display_current();
55 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
58 xbt_os_thread_t xbt_os_thread_self(void)
60 xbt_backtrace_display_current();
62 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)");
65 void xbt_os_thread_yield(void)
67 xbt_backtrace_display_current();
69 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)");
73 xbt_os_mutex_t xbt_os_mutex_init(void)
76 xbt_backtrace_display_current();
78 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)");
83 void xbt_os_mutex_acquire(xbt_os_mutex_t mutex)
86 xbt_backtrace_display_current();
88 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_acquire)");
92 void xbt_os_mutex_release(xbt_os_mutex_t mutex)
95 xbt_backtrace_display_current();
97 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_release)");
101 void xbt_os_mutex_destroy(xbt_os_mutex_t mutex)
104 xbt_backtrace_display_current();
106 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)");
110 xbt_os_cond_t xbt_os_cond_init(void)
112 xbt_backtrace_display_current();
114 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)");
117 void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex)
119 xbt_backtrace_display_current();
121 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)");
124 void xbt_os_cond_signal(xbt_os_cond_t cond)
126 xbt_backtrace_display_current();
128 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)");
131 void xbt_os_cond_broadcast(xbt_os_cond_t cond)
133 xbt_backtrace_display_current();
135 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)");
138 void xbt_os_cond_destroy(xbt_os_cond_t cond)
140 xbt_backtrace_display_current();
142 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)");