3 /* xbt_os_thread_stub -- empty functions used in SG, but harmful in RL */
4 /* More specifically, it is loaded by xbt/context.c when CONTEXT_UCONTEXT */
5 /* When CONTEXT_THREAD, xbt_os_thread is loaded instead (to get real func) */
6 /* In RL, xbt_os_thread is part of GRAS_RL_SRC */
8 /* Copyright (c) 2007 Martin Quinson. */
9 /* All rights reserved. */
11 /* This program is free software; you can redistribute it and/or modify it
12 * under the terms of the license (GNU LGPL) which comes with this package. */
14 #include "xbt_modinter.h"
15 #include "xbt/sysdep.h"
16 #include "xbt/xbt_os_thread.h"
17 #include "portable.h" /* CONTEXT_THREADS */
19 #ifndef CONTEXT_THREADS
21 /* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context.
22 * The decision (and the loading) is made in xbt/context.c.
25 /* Mod_init/exit mecanism */
26 void xbt_os_thread_mod_init(void) {}
28 void xbt_os_thread_mod_exit(void) {}
33 xbt_os_thread_t xbt_os_thread_create(const char*name,pvoid_f_pvoid_t start_routine,void* param) {
34 xbt_backtrace_display_current();
35 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)");
38 void xbt_os_thread_exit(int *retcode){
39 xbt_backtrace_display_current();
40 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
43 xbt_os_thread_t xbt_os_thread_self(void){
44 xbt_backtrace_display_current();
45 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)");
48 void xbt_os_thread_yield(void){
49 xbt_backtrace_display_current();
50 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)");
54 xbt_os_mutex_t xbt_os_mutex_init(void){
55 xbt_backtrace_display_current();
56 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)");
59 void xbt_os_mutex_lock(xbt_os_mutex_t mutex){
60 xbt_backtrace_display_current();
61 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_lock)");
64 void xbt_os_mutex_unlock(xbt_os_mutex_t mutex){
65 xbt_backtrace_display_current();
66 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_unlock)");
69 void xbt_os_mutex_destroy(xbt_os_mutex_t mutex){
70 xbt_backtrace_display_current();
71 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)");
74 xbt_os_cond_t xbt_os_cond_init(void){
75 xbt_backtrace_display_current();
76 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)");
79 void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex){
80 xbt_backtrace_display_current();
81 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)");
84 void xbt_os_cond_signal(xbt_os_cond_t cond){
85 xbt_backtrace_display_current();
86 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)");
89 void xbt_os_cond_broadcast(xbt_os_cond_t cond){
90 xbt_backtrace_display_current();
91 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)");
94 void xbt_os_cond_destroy(xbt_os_cond_t cond){
95 xbt_backtrace_display_current();
96 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)");