2 * threads.h: Threading API
5 * Dick Porter (dick@ximian.com)
6 * Patrik Torstensson (patrik.torstensson@labs2.com)
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>
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
,
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);
51 #endif /* _MONO_METADATA_THREADS_H_ */