2 * mono-tls.c: Low-level TLS support
4 * Copyright 2013 Xamarin, Inc (http://www.xamarin.com)
11 static int tls_offsets
[TLS_KEY_NUM
];
12 static gboolean tls_offset_set
[TLS_KEY_NUM
];
15 * mono_tls_key_get_offset:
17 * Return the TLS offset used by the TLS var identified by KEY, previously initialized by a call to
18 * mono_tls_key_set_offset (). Return -1 if the offset is not known.
21 mono_tls_key_get_offset (MonoTlsKey key
)
23 g_assert (tls_offset_set
[key
]);
24 return tls_offsets
[key
];
28 * mono_tls_key_set_offset:
30 * Set the TLS offset used by the TLS var identified by KEY.
33 mono_tls_key_set_offset (MonoTlsKey key
, int offset
)
35 tls_offsets
[key
] = offset
;
36 tls_offset_set
[key
] = TRUE
;