Add IObserver/IObservable to MOBILE profile.
[mono-project.git] / mono / metadata / threads.h
blob67001bed4cf11618e6e3aaaf30e9203361621b46
1 /*
2 * threads.h: Threading API
4 * Author:
5 * Dick Porter (dick@ximian.com)
6 * Patrik Torstensson (patrik.torstensson@labs2.com)
8 * (C) 2001 Ximian, Inc
9 */
11 #ifndef _MONO_METADATA_THREADS_H_
12 #define _MONO_METADATA_THREADS_H_
14 #include <mono/utils/mono-publib.h>
15 #include <mono/metadata/object.h>
16 #include <mono/metadata/appdomain.h>
18 MONO_BEGIN_DECLS
20 /* This callback should return TRUE if the runtime must wait for the thread, FALSE otherwise */
21 typedef mono_bool (*MonoThreadManageCallback) (MonoThread* thread);
23 extern void mono_thread_init (MonoThreadStartCB start_cb,
24 MonoThreadAttachCB attach_cb);
25 extern void mono_thread_cleanup (void);
26 extern void mono_thread_manage(void);
28 extern MonoThread *mono_thread_current (void);
30 extern void mono_thread_set_main (MonoThread *thread);
31 extern MonoThread *mono_thread_get_main (void);
33 extern void mono_thread_stop (MonoThread *thread);
35 extern void mono_thread_new_init (intptr_t tid, void* stack_start,
36 void* func);
37 extern void mono_thread_create (MonoDomain *domain, void* func, void* arg);
38 extern MonoThread *mono_thread_attach (MonoDomain *domain);
39 extern void mono_thread_detach (MonoThread *thread);
40 extern void mono_thread_exit (void);
42 void mono_thread_set_manage_callback (MonoThread *thread, MonoThreadManageCallback func);
44 extern void mono_threads_set_default_stacksize (uint32_t stacksize);
45 extern uint32_t mono_threads_get_default_stacksize (void);
47 void mono_threads_request_thread_dump (void);
49 MONO_END_DECLS
51 #endif /* _MONO_METADATA_THREADS_H_ */