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
25 /* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context.
26 * The decision (and the loading) is made in xbt/context.c.
29 /* Mod_init/exit mecanism */
30 void xbt_os_thread_mod_preinit(void)
34 void xbt_os_thread_mod_postexit(void)
41 xbt_os_thread_t xbt_os_thread_create(const char *name,
42 pvoid_f_pvoid_t start_routine,
45 xbt_backtrace_display_current();
47 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)");
50 void xbt_os_thread_exit(int *retcode)
52 xbt_backtrace_display_current();
54 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
57 xbt_os_thread_t xbt_os_thread_self(void)
59 xbt_backtrace_display_current();
61 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)");
64 void xbt_os_thread_yield(void)
66 xbt_backtrace_display_current();
68 ("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)");
72 xbt_os_mutex_t xbt_os_mutex_init(void)
74 xbt_backtrace_display_current();
76 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)");
79 void xbt_os_mutex_acquire(xbt_os_mutex_t mutex)
81 xbt_backtrace_display_current();
83 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_acquire)");
86 void xbt_os_mutex_release(xbt_os_mutex_t mutex)
88 xbt_backtrace_display_current();
90 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_release)");
93 void xbt_os_mutex_destroy(xbt_os_mutex_t mutex)
95 xbt_backtrace_display_current();
97 ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)");
100 xbt_os_cond_t xbt_os_cond_init(void)
102 xbt_backtrace_display_current();
104 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)");
107 void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex)
109 xbt_backtrace_display_current();
111 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)");
114 void xbt_os_cond_signal(xbt_os_cond_t cond)
116 xbt_backtrace_display_current();
118 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)");
121 void xbt_os_cond_broadcast(xbt_os_cond_t cond)
123 xbt_backtrace_display_current();
125 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)");
128 void xbt_os_cond_destroy(xbt_os_cond_t cond)
130 xbt_backtrace_display_current();
132 ("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)");