X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fruntime%2Fthread.c;h=f8cb1ca804f72969e3c1cdf61d9d3cc444cbc276;hb=4bf2de6a2adff75459cf218c8bff67f6cdb91211;hp=038f16bc1cee9dd8afff81ccad41ffb0575ed24a;hpb=ae09f8fd7765f6cab6ad317a13e27ff22ab0c11e;p=sbcl.git diff --git a/src/runtime/thread.c b/src/runtime/thread.c index 038f16b..f8cb1ca 100644 --- a/src/runtime/thread.c +++ b/src/runtime/thread.c @@ -63,8 +63,6 @@ #define LOCK_CREATE_THREAD #endif -#define ALIEN_STACK_SIZE (1*1024*1024) /* 1Mb size chosen at random */ - #ifdef LISP_FEATURE_SB_THREAD struct thread_post_mortem { #ifdef DELAY_THREAD_POST_MORTEM @@ -135,7 +133,9 @@ initial_thread_trampoline(struct thread *th) link_thread(th); th->os_thread=thread_self(); #ifndef LISP_FEATURE_WIN32 - protect_control_stack_guard_page(1); + protect_control_stack_guard_page(1, NULL); + protect_binding_stack_guard_page(1, NULL); + protect_alien_stack_guard_page(1, NULL); #endif #if defined(LISP_FEATURE_X86) || defined(LISP_FEATURE_X86_64) @@ -268,7 +268,9 @@ new_thread_trampoline(struct thread *th) } th->os_thread=thread_self(); - protect_control_stack_guard_page(1); + protect_control_stack_guard_page(1, NULL); + protect_binding_stack_guard_page(1, NULL); + protect_alien_stack_guard_page(1, NULL); /* Since GC can only know about this thread from the all_threads * list and we're just adding this thread to it, there is no * danger of deadlocking even with SIG_STOP_FOR_GC blocked (which @@ -521,13 +523,15 @@ boolean create_os_thread(struct thread *th,os_thread_t *kid_tid) #endif if((initcode = pthread_attr_init(th->os_attr)) || - /* call_into_lisp_first_time switches the stack for the initial thread. For the - * others, we use this. */ - (pthread_attr_setstack(th->os_attr,th->control_stack_start,thread_control_stack_size)) || + /* call_into_lisp_first_time switches the stack for the initial + * thread. For the others, we use this. */ + (pthread_attr_setstack(th->os_attr,th->control_stack_start, + thread_control_stack_size)) || (retcode = pthread_create (kid_tid,th->os_attr,(void *(*)(void *))new_thread_trampoline,th))) { FSHOW_SIGNAL((stderr, "init = %d\n", initcode)); - FSHOW_SIGNAL((stderr, printf("pthread_create returned %d, errno %d\n", retcode, errno))); + FSHOW_SIGNAL((stderr, "pthread_create returned %d, errno %d\n", + retcode, errno)); if(retcode < 0) { perror("create_os_thread"); }