Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Reindent everything (possibly breaking all branches, but for the last time)
[simgrid.git] / src / xbt / xbt_sg_stubs.c
1 /* $Id$ */
2
3 /* xbt_sg_stubs -- empty functions sometimes used in SG (never in RL)       */
4
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.                                                */
10
11 /* In RL, java is useless, and threads are always part of the picture,      */
12 /*  ucontext never */
13
14 /* Copyright (c) 2007 Martin Quinson.                                       */
15 /* All rights reserved.                                                     */
16
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. */
19
20 #include "xbt_modinter.h"
21 #include "xbt/sysdep.h"
22 #include "xbt/xbt_os_thread.h"
23 #include "portable.h"           /* CONTEXT_THREADS */
24
25 #ifndef CONTEXT_THREADS
26
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.
29  */
30
31 /* Mod_init/exit mecanism */
32 void xbt_os_thread_mod_init(void)
33 {
34 }
35
36 void xbt_os_thread_mod_exit(void)
37 {
38 }
39
40
41 /* Main functions */
42
43 xbt_os_thread_t xbt_os_thread_create(const char *name,
44                                      pvoid_f_pvoid_t start_routine,
45                                      void *param)
46 {
47   xbt_backtrace_display_current();
48   xbt_die
49     ("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)");
50 }
51
52 void xbt_os_thread_exit(int *retcode)
53 {
54   xbt_backtrace_display_current();
55   xbt_die
56     ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
57 }
58
59 xbt_os_thread_t xbt_os_thread_self(void)
60 {
61   xbt_backtrace_display_current();
62   xbt_die
63     ("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)");
64 }
65
66 void xbt_os_thread_yield(void)
67 {
68   xbt_backtrace_display_current();
69   xbt_die
70     ("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)");
71 }
72
73
74 xbt_os_mutex_t xbt_os_mutex_init(void)
75 {
76   xbt_backtrace_display_current();
77   xbt_die
78     ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)");
79 }
80
81 void xbt_os_mutex_acquire(xbt_os_mutex_t mutex)
82 {
83   xbt_backtrace_display_current();
84   xbt_die
85     ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_acquire)");
86 }
87
88 void xbt_os_mutex_release(xbt_os_mutex_t mutex)
89 {
90   xbt_backtrace_display_current();
91   xbt_die
92     ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_release)");
93 }
94
95 void xbt_os_mutex_destroy(xbt_os_mutex_t mutex)
96 {
97   xbt_backtrace_display_current();
98   xbt_die
99     ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)");
100 }
101
102 xbt_os_cond_t xbt_os_cond_init(void)
103 {
104   xbt_backtrace_display_current();
105   xbt_die
106     ("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)");
107 }
108
109 void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex)
110 {
111   xbt_backtrace_display_current();
112   xbt_die
113     ("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)");
114 }
115
116 void xbt_os_cond_signal(xbt_os_cond_t cond)
117 {
118   xbt_backtrace_display_current();
119   xbt_die
120     ("No pthread in SG when compiled against the ucontext (xbt_os_cond_signal)");
121 }
122
123 void xbt_os_cond_broadcast(xbt_os_cond_t cond)
124 {
125   xbt_backtrace_display_current();
126   xbt_die
127     ("No pthread in SG when compiled against the ucontext (xbt_os_cond_broadcast)");
128 }
129
130 void xbt_os_cond_destroy(xbt_os_cond_t cond)
131 {
132   xbt_backtrace_display_current();
133   xbt_die
134     ("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)");
135 }
136 #endif
137
138
139 #ifndef HAVE_JAVA
140 #include "xbt/xbt_context_private.h"
141 void xbt_ctx_java_factory_init(xbt_context_factory_t * factory)
142 {
143 }
144 #endif