2001-11-06 Dietmar Maurer <dietmar@ximian.com>
[mono.git] / mono / metadata / threads-dummy.c
1 /*
2  * threads-dummy.c: System-specific thread support dummy routines
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2001 Ximian, Inc.
8  */
9
10 #include <config.h>
11 #include <glib.h>
12
13 #include <mono/metadata/object.h>
14 #include <mono/metadata/threads.h>
15
16 static MonoObject *main_thread;
17
18 guint32 ves_icall_System_Threading_Thread_Thread_internal(MonoObject *this,
19                                                           MonoObject *start)
20 {
21         return(0);
22 }
23
24 void ves_icall_System_Threading_Thread_Start_internal(MonoObject *this,
25                                                       guint32 id)
26 {
27 }
28
29
30 gint32 ves_icall_System_Threading_Thread_Sleep_internal(gint32 ms)
31 {
32         return(0);
33 }
34
35 void ves_icall_System_Threading_Thread_Schedule_internal(void)
36 {
37 }
38
39 MonoObject *ves_icall_System_Threading_Thread_CurrentThread_internal(void)
40 {
41         return(main_thread);
42 }
43
44 gboolean ves_icall_System_Threading_Thread_Join_internal(MonoObject *this,
45                                                          int ms, guint32 tid)
46 {
47         return(TRUE);
48 }
49
50 void ves_icall_System_Threading_Thread_DataSlot_register(MonoObject *slot)
51 {
52 }
53
54 void ves_icall_System_Threading_Thread_DataSlot_store(MonoObject *slot,
55                                                       MonoObject *data)
56 {
57 }
58
59 MonoObject *ves_icall_System_Threading_Thread_DataSlot_retrieve(MonoObject *slot)
60 {
61         return(NULL);
62 }
63
64 void ves_icall_System_LocalDataStoreSlot_DataSlot_unregister(MonoObject *this)
65 {
66 }
67
68 void ves_icall_System_Threading_Monitor_Monitor_enter(MonoObject *obj)
69 {
70 }
71
72 void ves_icall_System_Threading_Monitor_Monitor_exit(MonoObject *obj)
73 {
74 }
75
76 gboolean ves_icall_System_Threading_Monitor_Monitor_test_owner(MonoObject *obj)
77 {
78         return(FALSE);
79 }
80
81 gboolean ves_icall_System_Threading_Monitor_Monitor_test_synchronised(MonoObject *obj)
82 {
83         return(FALSE);
84 }
85
86 void ves_icall_System_Threading_Monitor_Monitor_pulse(MonoObject *obj)
87 {
88 }
89
90 void ves_icall_System_Threading_Monitor_Monitor_pulse_all(MonoObject *obj)
91 {
92 }
93
94 gboolean ves_icall_System_Threading_Monitor_Monitor_try_enter(MonoObject *obj, int ms)
95 {
96         return(FALSE);
97 }
98
99 gboolean ves_icall_System_Threading_Monitor_Monitor_wait(MonoObject *obj, int ms)
100 {
101         return(FALSE);
102 }
103
104 void mono_thread_init(void)
105 {
106         MonoClass *thread_class;
107         
108         /* Build a System.Threading.Thread object instance to return
109          * for the main line's Thread.CurrentThread property.
110          */
111         thread_class=mono_class_from_name(mono_defaults.corlib, "System.Threading", "Thread");
112         
113         /* I wonder what happens if someone tries to destroy this
114          * object? In theory, I guess the whole program should act as
115          * though exit() were called :-)
116          */
117         main_thread=mono_new_object(thread_class);
118 }
119
120
121 void mono_thread_cleanup(void)
122 {
123 }