X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fthread.c;h=1889213ef3cf0bc72bf9214adcd78e469598a400;hb=35ab27e7aab71c94aa6be12da15603c7fd87fca8;hp=4d20d0ffcc9c1564b15e6a43608e6214129a7089;hpb=daa6f0ce672d8dc60176ff885da18e44ee0355c6;p=sbcl.git diff --git a/src/runtime/thread.c b/src/runtime/thread.c index 4d20d0f..1889213 100644 --- a/src/runtime/thread.c +++ b/src/runtime/thread.c @@ -401,6 +401,9 @@ undo_init_new_thread(struct thread *th, init_thread_data *scribble) #ifdef LISP_FEATURE_SB_SAFEPOINT block_blockable_signals(0, 0); gc_alloc_update_page_tables(BOXED_PAGE_FLAG, &th->alloc_region); +#if defined(LISP_FEATURE_SB_SAFEPOINT_STRICTLY) && !defined(LISP_FEATURE_WIN32) + gc_alloc_update_page_tables(BOXED_PAGE_FLAG, &th->sprof_alloc_region); +#endif pop_gcing_safety(&scribble->safety); lock_ret = pthread_mutex_lock(&all_threads_lock); gc_assert(lock_ret == 0); @@ -418,6 +421,9 @@ undo_init_new_thread(struct thread *th, init_thread_data *scribble) gc_assert(lock_ret == 0); gc_alloc_update_page_tables(BOXED_PAGE_FLAG, &th->alloc_region); +#if defined(LISP_FEATURE_SB_SAFEPOINT_STRICTLY) && !defined(LISP_FEATURE_WIN32) + gc_alloc_update_page_tables(BOXED_PAGE_FLAG, &th->sprof_alloc_region); +#endif unlink_thread(th); pthread_mutex_unlock(&all_threads_lock); gc_assert(lock_ret == 0); @@ -529,7 +535,7 @@ attach_os_thread(init_thread_data *scribble) * tempting to just perform such unsafe allocation though. So let's * at least try to suppress GC before consing, and hope that it * works: */ - SetSymbolValue(GC_INHIBIT, T, th); + bind_variable(GC_INHIBIT, T, th); uword_t stacksize = (uword_t) th->control_stack_end - (uword_t) th->control_stack_start; @@ -689,7 +695,7 @@ create_thread_struct(lispobj initial_function) { th->state_not_stopped_waitcount = 0; #endif th->state=STATE_RUNNING; -#ifdef LISP_FEATURE_STACK_GROWS_DOWNWARD_NOT_UPWARD +#ifdef ALIEN_STACK_GROWS_DOWNWARD th->alien_stack_pointer=((void *)th->alien_stack_start + ALIEN_STACK_SIZE-N_WORD_BYTES); #else @@ -700,6 +706,9 @@ create_thread_struct(lispobj initial_function) { #endif #ifdef LISP_FEATURE_GENCGC gc_set_region_empty(&th->alloc_region); +# if defined(LISP_FEATURE_SB_SAFEPOINT_STRICTLY) && !defined(LISP_FEATURE_WIN32) + gc_set_region_empty(&th->sprof_alloc_region); +# endif #endif #ifdef LISP_FEATURE_SB_THREAD /* This parallels the same logic in globals.c for the @@ -826,8 +835,13 @@ boolean create_os_thread(struct thread *th,os_thread_t *kid_tid) #if defined(LISP_FEATURE_WIN32) (pthread_attr_setstacksize(th->os_attr, thread_control_stack_size)) || #else +# if defined(LISP_FEATURE_C_STACK_IS_CONTROL_STACK) (pthread_attr_setstack(th->os_attr,th->control_stack_start, thread_control_stack_size)) || +# else + (pthread_attr_setstack(th->os_attr,th->alien_stack_start, + ALIEN_STACK_SIZE)) || +# endif #endif (retcode = pthread_create (kid_tid,th->os_attr,(void *(*)(void *))new_thread_trampoline,th))) {