From: Daniel Barlow Date: Tue, 22 Mar 2005 19:32:26 +0000 (+0000) Subject: 0.8.20.30: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=10adbe19b88bf9d4fe65ad67f6de0fd065af87ff;p=sbcl.git 0.8.20.30: Slightly nicer behaviour on non-NPTL systems makes it possible to use thread-enabled binaries in thread-unfriendly environments again - but a warning is issued at startup and MAKE-THREAD signals an error Remove some slightly odd-looking stuff in make-config.sh: once again it is possible to "SBCL_ARCH=x86 sh make.sh" on an x86-64 --- diff --git a/NEWS b/NEWS index c872529..9649fd2 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,8 @@ changes in sbcl-0.8.21 (0.9alpha.1?) relative to sbcl-0.8.20: * incompatible change: thread support for non-NPTL systems has been removed - locking is buggy and unreliable. A threaded - SBCL build will now refuse to start unless futex support is - detected in the kernel + SBCL build will now warn at startup and refuse to create + new threads, unless futex support is detected in the kernel * incompatible change: the top level REPL now has only an ABORT restart associated with it, not TOPLEVEL and ABORT as it used to. TOP and TOPLEVEL are now available as debugger commands for diff --git a/make-config.sh b/make-config.sh index fe1981c..a8cad3f 100644 --- a/make-config.sh +++ b/make-config.sh @@ -97,11 +97,7 @@ case `uname` in Linux) printf ' :linux' >> $ltf sbcl_os="linux" - if [ "`uname -m`" = "x86_64" ]; then - ln -s Config.x86_64-linux Config - else - ln -s Config.$sbcl_arch-linux Config - fi + ln -s Config.$sbcl_arch-linux Config ln -s $sbcl_arch-linux-os.h target-arch-os.h ln -s linux-os.h target-os.h ;; diff --git a/src/code/target-thread.lisp b/src/code/target-thread.lisp index aedfa10..fe34aac 100644 --- a/src/code/target-thread.lisp +++ b/src/code/target-thread.lisp @@ -185,6 +185,7 @@ time we reacquire LOCK and return to the caller." (funcall real-function)) 0)) (values)))))) + (when (zerop tid) (error "Can't create a new thread")) (with-mutex ((session-lock *session*)) (pushnew tid (session-threads *session*))) tid)) diff --git a/src/runtime/linux-os.c b/src/runtime/linux-os.c index 077f441..669ae7c 100644 --- a/src/runtime/linux-os.c +++ b/src/runtime/linux-os.c @@ -73,6 +73,7 @@ _syscall4(int,sys_futex, #include "gc.h" int linux_sparc_siginfo_bug = 0; +int linux_no_threads_p = 0; void os_init(void) { @@ -100,9 +101,9 @@ void os_init(void) } #ifdef LISP_FEATURE_SB_THREAD futex_wait(futex,-1); - if(errno==ENOSYS) { - lose("linux with NPTL support (e.g. kernel 2.6 or newer) required for thread-enabled SBCL"); - } + if(errno==ENOSYS) linux_no_threads_p = 1; + if(linux_no_threads_p) + fprintf(stderr,"Linux with NPTL support (e.g. kernel 2.6 or newer) required for \nthread-enabled SBCL. Disabling thread support.\n\n"); #endif os_vm_page_size = getpagesize(); } diff --git a/src/runtime/thread.c b/src/runtime/thread.c index 43d551a..0f28c30 100644 --- a/src/runtime/thread.c +++ b/src/runtime/thread.c @@ -28,6 +28,7 @@ int dynamic_values_bytes=4096*sizeof(lispobj); /* same for all threads */ struct thread *all_threads; volatile lispobj all_threads_lock; extern struct interrupt_data * global_interrupt_data; +extern int linux_no_threads_p; int initial_thread_trampoline(struct thread *th) @@ -230,9 +231,11 @@ void create_initial_thread(lispobj initial_function) { #ifdef LISP_FEATURE_SB_THREAD pid_t create_thread(lispobj initial_function) { - struct thread *th=create_thread_struct(initial_function); + struct thread *th; pid_t kid_pid=0; + if(linux_no_threads_p) return 0; + th=create_thread_struct(initial_function); if(th==0) return 0; kid_pid=clone(new_thread_trampoline, (((void*)th->control_stack_start)+ diff --git a/version.lisp-expr b/version.lisp-expr index 90840e9..f56c083 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.20.29" +"0.8.20.30"