[Places] make jit lock thread local

This commit is contained in:
Kevin Tew 2010-05-04 12:01:27 -06:00
parent e3e8a54ee9
commit 9a61471f06
3 changed files with 7 additions and 4 deletions

View File

@ -282,6 +282,7 @@ typedef struct Thread_Local_Variables {
struct Scheme_Object *dummy_output_port_;
struct Scheme_Bucket_Table *place_local_modpath_table_;
struct Scheme_Hash_Table *opened_libs_;
struct mzrt_mutex *jit_lock_;
/*KPLAKE1*/
} Thread_Local_Variables;
@ -566,6 +567,7 @@ XFORM_GC_VARIABLE_STACK_THROUGH_THREAD_LOCAL;
#define dummy_output_port XOA (scheme_get_thread_local_variables()->dummy_output_port_)
#define place_local_modpath_table XOA (scheme_get_thread_local_variables()->place_local_modpath_table_)
#define opened_libs XOA (scheme_get_thread_local_variables()->opened_libs_)
#define jit_lock XOA (scheme_get_thread_local_variables()->jit_lock_)
/*KPLAKE2*/
/* **************************************** */

View File

@ -356,9 +356,6 @@ Scheme_Env *scheme_engine_instance_init() {
scheme_init_foreign_globals();
#endif
scheme_init_salloc();
#ifdef MZ_USE_JIT
scheme_init_jit();
#endif
make_kernel_env();
#if defined(MZ_PRECISE_GC) && defined(MZ_USE_PLACES)
@ -479,6 +476,10 @@ static Scheme_Env *place_instance_init(void *stack_base, int initial_main_os_thr
printf("process @ %ld\n", scheme_get_process_milliseconds());
#endif
#ifdef MZ_USE_JIT
scheme_init_jit();
#endif
/* error handling and buffers */
/* this check prevents initializing orig ports twice for the first initial
* place. The kernel initializes orig_ports early. */

View File

@ -744,7 +744,7 @@ static void emit_indentation(mz_jit_state *jitter)
#ifdef MZ_USE_PLACES
static mzrt_mutex *jit_lock;
THREAD_LOCAL_DECL(static mzrt_mutex *jit_lock);
THREAD_LOCAL_DECL(static int in_jit_critical_section);
static void BEGIN_JIT_CRITICAL_SECTION()