Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add new function : xbt_dict_is_empty
[simgrid.git] / src / xbt / xbt_sg_stubs.c
1 /* xbt_sg_stubs -- empty functions sometimes used in SG (never in RL)       */
2
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.                                                */
8
9 /* In RL, java is useless, and threads are always part of the picture,      */
10 /*  ucontext never */
11
12 /* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
13  * All rights reserved.                                                     */
14
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. */
17
18 #include "xbt_modinter.h"
19 #include "xbt/sysdep.h"
20 #include "xbt/xbt_os_thread.h"
21 #include "portable.h"           /* CONTEXT_THREADS */
22
23 #ifndef CONTEXT_THREADS
24
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.
27  */
28
29 /* Mod_init/exit mecanism */
30 void xbt_os_thread_mod_preinit(void)
31 {
32 }
33
34 void xbt_os_thread_mod_postexit(void)
35 {
36 }
37
38
39 /* Main functions */
40
41 xbt_os_thread_t xbt_os_thread_create(const char *name,
42                                      pvoid_f_pvoid_t start_routine,
43                                      void *param)
44 {
45   xbt_backtrace_display_current();
46   xbt_die
47     ("No pthread in SG when compiled against the ucontext (xbt_os_thread_create)");
48 }
49
50 void xbt_os_thread_exit(int *retcode)
51 {
52   xbt_backtrace_display_current();
53   xbt_die
54     ("No pthread in SG when compiled against the ucontext (xbt_os_thread_exit)");
55 }
56
57 xbt_os_thread_t xbt_os_thread_self(void)
58 {
59   xbt_backtrace_display_current();
60   xbt_die
61     ("No pthread in SG when compiled against the ucontext (xbt_os_thread_self)");
62 }
63
64 void xbt_os_thread_yield(void)
65 {
66   xbt_backtrace_display_current();
67   xbt_die
68     ("No pthread in SG when compiled against the ucontext (xbt_os_thread_yield)");
69 }
70
71
72 xbt_os_mutex_t xbt_os_mutex_init(void)
73 {
74    /*
75   xbt_backtrace_display_current();
76   xbt_die
77     ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_init)");
78     */
79    return NULL;
80 }
81
82 void xbt_os_mutex_acquire(xbt_os_mutex_t mutex)
83 {
84    /*
85   xbt_backtrace_display_current();
86   xbt_die
87     ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_acquire)");
88     */
89 }
90
91 void xbt_os_mutex_release(xbt_os_mutex_t mutex)
92 {
93    /*
94   xbt_backtrace_display_current();
95   xbt_die
96     ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_release)");
97     */
98 }
99
100 void xbt_os_mutex_destroy(xbt_os_mutex_t mutex)
101 {
102    /*
103   xbt_backtrace_display_current();
104   xbt_die
105     ("No pthread in SG when compiled against the ucontext (xbt_os_mutex_destroy)");
106     */
107 }
108
109 xbt_os_cond_t xbt_os_cond_init(void)
110 {
111   xbt_backtrace_display_current();
112   xbt_die
113     ("No pthread in SG when compiled against the ucontext (xbt_os_cond_init)");
114 }
115
116 void xbt_os_cond_wait(xbt_os_cond_t cond, xbt_os_mutex_t mutex)
117 {
118   xbt_backtrace_display_current();
119   xbt_die
120     ("No pthread in SG when compiled against the ucontext (xbt_os_cond_wait)");
121 }
122
123 void xbt_os_cond_signal(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_signal)");
128 }
129
130 void xbt_os_cond_broadcast(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_broadcast)");
135 }
136
137 void xbt_os_cond_destroy(xbt_os_cond_t cond)
138 {
139   xbt_backtrace_display_current();
140   xbt_die
141     ("No pthread in SG when compiled against the ucontext (xbt_os_cond_destroy)");
142 }
143 #endif