Use mir_mutex_(un)lock.
@@ -486,9 +486,7 @@ void *_MIR_get_wrapper (MIR_context_t ctx, MIR_item_t called_func, void *hook_ad
size_t len = sizeof (save_insns) + sizeof (restore_insns); /* initial code length */
VARR (uint8_t) * code;
-#if MIR_PARALLEL_GEN
- pthread_mutex_lock (&code_mutex);
-#endif
+ mir_mutex_lock (&code_mutex);
VARR_CREATE (uint8_t, code, 128);
for (;;) { /* dealing with moving code to another page */
curr_addr = base_addr = _MIR_get_new_code_addr (ctx, len);
@@ -510,8 +508,6 @@ void *_MIR_get_wrapper (MIR_context_t ctx, MIR_item_t called_func, void *hook_ad
if (res_code != NULL) break;
}
VARR_DESTROY (uint8_t, code);
-#if MIR_PARALLEL_GEN
- pthread_mutex_unlock (&code_mutex);
-#endif
+ mir_mutex_unlock (&code_mutex);
return res_code;
}
