# define HOOK_ENTER_INTERPRETER(func) func ()
#endif
\f
+extern void initialize_processor_early (void);
static void start_scheme (void);
static void Enter_Interpreter (void);
const char * scheme_program_name;
const char * OS_Name;
const char * OS_Variant;
-struct obstack scratch_obstack;
-struct obstack ffi_obstack;
-void * initial_C_stack_pointer;
+__thread struct obstack scratch_obstack;
+__thread struct obstack ffi_obstack;
+static void * initial_C_stack_pointer;
static char * reload_saved_string;
static unsigned int reload_saved_string_length;
#ifdef __OS2__
OS2_initialize_early ();
#endif
- obstack_init (&scratch_obstack);
- obstack_init (&ffi_obstack);
- dstack_initialize ();
- transaction_initialize ();
+ initialize_processor_early ();
+
reload_saved_string = 0;
reload_saved_string_length = 0;
read_command_line_options (argc, argv);
termination_init_error ();
return (0);
}
+
+void
+initialize_processor_early (void)
+{
+ obstack_init (&scratch_obstack);
+ obstack_init (&ffi_obstack);
+ dstack_initialize ();
+ transaction_initialize ();
+}
\f
/* Boot Scheme */
#ifndef SCM_CRITSEC_H
#define SCM_CRITSEC_H 1
-extern const char * critical_section_name;
-extern bool critical_section_hook_p;
-extern void (*critical_section_hook) (const char *);
+extern __thread const char * critical_section_name;
+extern __thread bool critical_section_hook_p;
+extern __thread void (*critical_section_hook) (const char *);
#define DECLARE_CRITICAL_SECTION() \
- const char * critical_section_name = 0; \
- bool critical_section_hook_p; \
- void (*critical_section_hook) (const char *)
+ __thread const char * critical_section_name = 0; \
+ __thread bool critical_section_hook_p; \
+ __thread void (*critical_section_hook) (const char *)
#define ENTER_CRITICAL_SECTION(name) critical_section_name = (name)
#define RENAME_CRITICAL_SECTION(name) critical_section_name = (name)
initialize that space, and create an unwind protection frame that
invokes `protector' when the stack is unwound. */
-extern void * dstack_position;
+extern __thread void * dstack_position;
/* The current stack pointer. */
extern void dstack_set_position (void * position);
extern const char * scheme_program_name;
extern const char * OS_Name;
extern const char * OS_Variant;
-extern struct obstack scratch_obstack;
-extern struct obstack ffi_obstack;
+extern __thread struct obstack scratch_obstack;
+extern __thread struct obstack ffi_obstack;
extern SCHEME_OBJECT * memory_block_start;
extern SCHEME_OBJECT * memory_block_end;
typedef char fexcept_t;
#endif
\f
-static bool scheme_fenv_p = false;
-static fenv_t scheme_fenv;
+static __thread bool scheme_fenv_p = false;
+static __thread fenv_t scheme_fenv;
static void
cache_float_environment (void)
\f
/* The EVAL/APPLY yin/yang */
-interpreter_state_t interpreter_state = NULL_INTERPRETER_STATE;
+__thread interpreter_state_t interpreter_state = NULL_INTERPRETER_STATE;
void
bind_interpreter_state (interpreter_state_t s)
return (interpreter_throw_argument);
}
-long prim_apply_error_code;
+__thread long prim_apply_error_code;
\f
void
Interpret (int pop_return_p)
extern void abort_to_interpreter (int) NORETURN;
extern int abort_to_interpreter_argument (void);
-extern interpreter_state_t interpreter_state;
-extern long prim_apply_error_code;
+extern __thread interpreter_state_t interpreter_state;
+extern __thread long prim_apply_error_code;
extern void bind_interpreter_state (interpreter_state_t);
extern void unbind_interpreter_state (interpreter_state_t);
RESET_HISTORY ();
}
+extern void initialize_processor_early (void);
+
static void *
work (void *p)
{
trace (";%d Start.", self->id);
assert (self->id != 0);
assert (self != processors);
+ initialize_processor_early ();
reset_processor_allocator (self);
RESET_HISTORY ();
enum transaction_state state;
};
-static struct transaction * current_transaction;
+static __thread struct transaction * current_transaction;
static void
guarantee_current_transaction (const char * proc)
void * environment;
};
-static struct obstack dstack;
-static struct winding_record * current_winding_record;
-void * dstack_position;
+static __thread struct obstack dstack;
+static __thread struct winding_record * current_winding_record;
+__thread void * dstack_position;
void
dstack_initialize (void)