3 /* xbt_sg_stubs -- empty functions sometimes used in SG (never in RL) */
5 /* This is always part of SG, never of RL. Content: */
6 /* - a bunch of stub functions of the thread related function that we need */
7 /* to add to the lib to please the linker when using ucontextes. */
8 /* - a bunch of stub functions of the java related function when we don't */
9 /* compile java bindings. */
11 /* In RL, java is useless, and threads are always part of the picture, */
14 /* Copyright (c) 2007 Martin Quinson. */
15 /* All rights reserved. */
17 /* This program is free software; you can redistribute it and/or modify it
18 * under the terms of the license (GNU LGPL) which comes with this package. */
20 #include "xbt_modinter.h"
21 #include "xbt/sysdep.h"
22 #include "xbt/xbt_os_thread.h"
23 #include "portable.h" /* CONTEXT_THREADS */
25 #ifndef CONTEXT_THREADS
27 /* xbt_threads is loaded in libsimgrid when they are used to implement the xbt_context.
28 * The decision (and the loading) is made in xbt/context.c.
31 /* Mod_init/exit mecanism */
32 void xbt_os_thread_mod_init(void) {}
34 void xbt_os_thread_mod_exit(void) {}
39 xbt_os_thread_t xbt_os_thread_create(const char*name,pvoid_f_pvoid_t start_routine,void* param) {
40 xbt_backtrace_display_current();
41 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)");
44 void xbt_os_thread_exit(int *retcode){
45 xbt_backtrace_display_current();
46 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
49 xbt_os_thread_t xbt_os_thread_self(void){
50 xbt_backtrace_display_current();
51 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)");
54 void xbt_os_thread_yield(void){
55 xbt_backtrace_display_current();
56 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)");
60 xbt_os_mutex_t xbt_os_mutex_init(void){
61 xbt_backtrace_display_current();
62 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)");
65 void xbt_os_mutex_acquire(xbt_os_mutex_t mutex){
66 xbt_backtrace_display_current();
67 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_acquire)");
70 void xbt_os_mutex_release(xbt_os_mutex_t mutex){
71 xbt_backtrace_display_current();
72 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_release)");
75 void xbt_os_mutex_destroy(xbt_os_mutex_t mutex){
76 xbt_backtrace_display_current();
77 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)");
80 xbt_os_cond_t xbt_os_cond_init(void){
81 xbt_backtrace_display_current();
82 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)");
85 void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex){
86 xbt_backtrace_display_current();
87 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)");
90 void xbt_os_cond_signal(xbt_os_cond_t cond){
91 xbt_backtrace_display_current();
92 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)");
95 void xbt_os_cond_broadcast(xbt_os_cond_t cond){
96 xbt_backtrace_display_current();
97 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)");
100 void xbt_os_cond_destroy(xbt_os_cond_t cond){
101 xbt_backtrace_display_current();
102 xbt_die("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)");
108 #include "xbt/xbt_context_private.h"
109 int xbt_jcontext_factory_init(xbt_context_factory_t* factory) {