[System] Fixes UdpClient.Receive with IPv6 endpoint
[mono.git] / mono / utils / mono-threads-api.h
1 /*
2  * mono-threads-api.h: Low level access to thread state.
3  *
4  * Author:
5  *      Rodrigo Kumpera (kumpera@gmail.com)
6  *
7  * (C) 2015 Xamarin
8  */
9
10 #ifndef __MONO_THREADS_API_H__
11 #define __MONO_THREADS_API_H__
12
13 #include <mono/utils/mono-publib.h>
14 MONO_BEGIN_DECLS
15
16 /*
17 >>>> WARNING WARNING WARNING <<<<
18
19 This API is experimental. It will eventually be required to properly use the rest of the raw-omp embedding API.
20 */
21
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);
25
26 /*
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.
29
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
32
33 */
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); }
36
37
38 MONO_END_DECLS
39
40 #endif /* __MONO_LOGGER_H__ */