mono_threads_unlock ();
}
-typedef struct {
- /* local tls data to get locals_slot from a thread */
- guint32 offset;
- /* index in the locals_slot array */
- int slot;
-} LocalSlotID;
-
-/*
- * LOCKING: requires that threads_mutex is held
- */
-static void
-clear_thread_local_slot (gpointer key, gpointer value, gpointer user_data)
-{
- MonoInternalThread *thread = (MonoInternalThread *) value;
- LocalSlotID *sid = user_data;
-
- int idx = ACCESS_SPECIAL_STATIC_OFFSET (sid->offset, index);
- int off = ACCESS_SPECIAL_STATIC_OFFSET (sid->offset, offset);
-
- if (!thread->static_data || !thread->static_data [idx])
- return;
-
- MonoArray *slots_array = *(MonoArray **)(((char *) thread->static_data [idx]) + off);
-
- if (!slots_array || sid->slot >= mono_array_length (slots_array))
- return;
-
- mono_array_set (slots_array, MonoObject *, sid->slot, NULL);
-}
-
-/*
- * LOCKING: requires that threads_mutex is held
- */
-static void
-clear_context_local_slot (gpointer key, gpointer value, gpointer user_data)
-{
- uint32_t gch = GPOINTER_TO_UINT (key);
- MonoAppContext *ctx = (MonoAppContext *) mono_gchandle_get_target (gch);
-
- if (!ctx) {
- g_hash_table_remove (contexts, key);
- mono_gchandle_free (gch);
- return;
- }
-
- LocalSlotID *sid = user_data;
-
- int idx = ACCESS_SPECIAL_STATIC_OFFSET (sid->offset, index);
- int off = ACCESS_SPECIAL_STATIC_OFFSET (sid->offset, offset);
-
- if (!ctx->static_data || !ctx->static_data [idx])
- return;
-
- MonoArray *slots_array = *(MonoArray **) (((char *) ctx->static_data [idx]) + off);
-
- if (!slots_array || sid->slot >= mono_array_length (slots_array))
- return;
-
- mono_array_set (slots_array, MonoObject *, sid->slot, NULL);
-}
-
#ifdef HOST_WIN32
static void CALLBACK dummy_apc (ULONG_PTR param)
{