[Places] THREAD_LOCAL opened_libs
This commit is contained in:
parent
521dab3243
commit
e3e8a54ee9
|
@ -192,7 +192,7 @@ int ffi_lib_FIXUP(void *p) {
|
|||
END_XFORM_SKIP;
|
||||
#endif
|
||||
|
||||
static Scheme_Hash_Table *opened_libs;
|
||||
THREAD_LOCAL_DECL(static Scheme_Hash_Table *opened_libs);
|
||||
|
||||
/* (ffi-lib filename no-error?) -> ffi-lib */
|
||||
#define MYNAME "ffi-lib"
|
||||
|
@ -2839,8 +2839,6 @@ void scheme_init_foreign_globals()
|
|||
GC_register_traversers(ffi_callback_tag, ffi_callback_SIZE, ffi_callback_MARK, ffi_callback_FIXUP, 1, 0);
|
||||
# endif /* MZ_PRECISE_GC */
|
||||
scheme_set_type_printer(ctype_tag, ctype_printer);
|
||||
MZ_REGISTER_STATIC(opened_libs);
|
||||
opened_libs = scheme_make_hash_table(SCHEME_hash_string);
|
||||
MZ_REGISTER_STATIC(default_sym);
|
||||
default_sym = scheme_intern_symbol("default");
|
||||
MZ_REGISTER_STATIC(stdcall_sym);
|
||||
|
@ -2869,6 +2867,11 @@ void scheme_init_foreign_globals()
|
|||
abs_sym = scheme_intern_symbol("abs");
|
||||
}
|
||||
|
||||
void scheme_init_foreign_places() {
|
||||
MZ_REGISTER_STATIC(opened_libs);
|
||||
opened_libs = scheme_make_hash_table(SCHEME_hash_string);
|
||||
}
|
||||
|
||||
void scheme_init_foreign(Scheme_Env *env)
|
||||
{
|
||||
Scheme_Env *menv;
|
||||
|
|
|
@ -162,7 +162,7 @@ END_XFORM_SKIP;
|
|||
[name "Scheme_Object*"]
|
||||
[objects "Scheme_Hash_Table*"]]
|
||||
|
||||
static Scheme_Hash_Table *opened_libs;
|
||||
THREAD_LOCAL_DECL(static Scheme_Hash_Table *opened_libs);
|
||||
|
||||
/* (ffi-lib filename no-error?) -> ffi-lib */
|
||||
@cdefine[ffi-lib 1 2]{
|
||||
|
@ -2199,14 +2199,17 @@ void scheme_init_foreign_globals()
|
|||
(reverse (cstructs)))
|
||||
}
|
||||
scheme_set_type_printer(ctype_tag, ctype_printer);
|
||||
MZ_REGISTER_STATIC(opened_libs);
|
||||
opened_libs = scheme_make_hash_table(SCHEME_hash_string);
|
||||
@(maplines (lambda (sym)
|
||||
@list{MZ_REGISTER_STATIC(@(cadr sym));
|
||||
@(cadr sym) = scheme_intern_symbol("@(car sym)")})
|
||||
(reverse (symbols)))
|
||||
}
|
||||
|
||||
void scheme_init_foreign_places() {
|
||||
MZ_REGISTER_STATIC(opened_libs);
|
||||
opened_libs = scheme_make_hash_table(SCHEME_hash_string);
|
||||
}
|
||||
|
||||
void scheme_init_foreign(Scheme_Env *env)
|
||||
{
|
||||
Scheme_Env *menv;
|
||||
|
|
|
@ -281,6 +281,7 @@ typedef struct Thread_Local_Variables {
|
|||
struct Scheme_Object *dummy_input_port_;
|
||||
struct Scheme_Object *dummy_output_port_;
|
||||
struct Scheme_Bucket_Table *place_local_modpath_table_;
|
||||
struct Scheme_Hash_Table *opened_libs_;
|
||||
/*KPLAKE1*/
|
||||
} Thread_Local_Variables;
|
||||
|
||||
|
@ -564,6 +565,7 @@ XFORM_GC_VARIABLE_STACK_THROUGH_THREAD_LOCAL;
|
|||
#define dummy_input_port XOA (scheme_get_thread_local_variables()->dummy_input_port_)
|
||||
#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_)
|
||||
/*KPLAKE2*/
|
||||
|
||||
/* **************************************** */
|
||||
|
|
|
@ -496,6 +496,7 @@ static Scheme_Env *place_instance_init(void *stack_base, int initial_main_os_thr
|
|||
scheme_init_gmp_places();
|
||||
scheme_alloc_global_fdset();
|
||||
scheme_init_file_places();
|
||||
scheme_init_foreign_places();
|
||||
|
||||
env = scheme_make_empty_env();
|
||||
scheme_set_param(scheme_current_config(), MZCONFIG_ENV, (Scheme_Object *)env);
|
||||
|
|
|
@ -266,6 +266,7 @@ void scheme_init_print_global_constants(void);
|
|||
void scheme_init_variable_references_constants(void);
|
||||
void scheme_init_logger(void);
|
||||
void scheme_init_file_places(void);
|
||||
void scheme_init_foreign_places(void);
|
||||
|
||||
Scheme_Logger *scheme_get_main_logger(void);
|
||||
void scheme_init_logger_config(void);
|
||||
|
|
Loading…
Reference in New Issue
Block a user