2 * mono-threads-api.h: Low level access to thread state.
5 * Rodrigo Kumpera (kumpera@gmail.com)
10 #ifndef __MONO_THREADS_API_H__
11 #define __MONO_THREADS_API_H__
13 #include <mono/utils/mono-publib.h>
17 >>>> WARNING WARNING WARNING <<<<
19 This API is experimental. It will eventually be required to properly use the rest of the raw-omp embedding API.
22 /* Don't use those directly, use the MONO_(BEGIN|END)_EFRAME */
23 MONO_API void* mono_threads_enter_gc_unsafe_region (void);
24 MONO_API void* mono_threads_exit_gc_unsafe_region (void *region_cookie);
27 Use those macros to limit regions of code that interact with managed memory or use the embedding API.
28 This will put the current thread in GC Unsafe mode.
30 For further explanation of what can and can't be done in GC unsafe mode:
31 http://www.mono-project.com/docs/advanced/runtime/docs/coop-suspend/#gc-unsafe-mode
34 #define MONO_BEGIN_EFRAME { void *__region_cookie = mono_threads_enter_gc_unsafe_region ();
35 #define MONO_END_EFRAME mono_threads_exit_gc_unsafe_region (__region_cookie); }
40 #endif /* __MONO_LOGGER_H__ */