amodule_lock (amodule);
- InterlockedIncrement (&mono_jit_stats.methods_aot);
-
- amodule->methods_loaded [method_index / 32] |= 1 << (method_index % 32);
-
init_plt (amodule);
+ InterlockedIncrement (&mono_jit_stats.methods_aot);
+
if (method && method->wrapper_type)
g_hash_table_insert (amodule->method_to_code, method, code);
+ /* Commit changes since methods_loaded is accessed outside the lock */
+ mono_memory_barrier ();
+
+ amodule->methods_loaded [method_index / 32] |= 1 << (method_index % 32);
+
amodule_unlock (amodule);
if (mono_profiler_get_events () & MONO_PROFILE_JIT_COMPILATION) {