Added the MembershipPasswordAttribute class and associated unit tests
[mono-project.git] / mono / utils / mono-tls.c
blob007dc4e6d225bd81336071a0fcda25750b5b8091
1 /*
2 * mono-tls.c: Low-level TLS support
4 * Copyright 2013 Xamarin, Inc (http://www.xamarin.com)
5 */
7 #include <config.h>
9 #include "mono-tls.h"
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.
20 int
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.
32 void
33 mono_tls_key_set_offset (MonoTlsKey key, int offset)
35 tls_offsets [key] = offset;
36 tls_offset_set [key] = TRUE;