Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Let the context version compile properly after the last 'sanitization' of the backtra...
[simgrid.git] / src / xbt / xbt_os_thread_stubs.c
1 /* $Id$ */
2
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                              */
7
8 /* Copyright (c) 2007 Martin Quinson.                                       */
9 /* All rights reserved.                                                     */
10
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. */
13
14 #include "xbt_modinter.h"
15 #include "xbt/sysdep.h"
16 #include "xbt/xbt_os_thread.h"
17 #include "portable.h" /* CONTEXT_THREADS */
18
19 #ifndef CONTEXT_THREADS
20
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.
23  */
24
25 /* Mod_init/exit mecanism */
26 void xbt_os_thread_mod_init(void) {}
27    
28 void xbt_os_thread_mod_exit(void) {}
29
30
31 /* Main functions */
32
33 xbt_os_thread_t xbt_os_thread_create(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)");
36 }
37
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)");
41 }
42
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)");
46 }
47
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)");
51 }
52
53
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)");
57 }
58
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)");
62 }
63
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)");
67 }
68
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)");
72 }
73
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)");
77 }
78
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)");
82 }
83
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)");
87 }
88
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)");
92 }
93
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)");
97 }
98
99
100 #endif