From: Daniel Barlow Date: Wed, 2 Apr 2003 12:46:19 +0000 (+0000) Subject: 0.pre8.29 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=c2e825e81b3ed9355f7f3e3607cbc0274daaee84;p=sbcl.git 0.pre8.29 === Threads merge, 50 metres === Thread-related cleanups: now builds threaded SBCL. ... use %fs not %gs throughout, in the vain hope that NPTL will be less likely to break on it ... various thinkos --- diff --git a/src/code/target-thread.lisp b/src/code/target-thread.lisp index 176336e..0a9ab3b 100644 --- a/src/code/target-thread.lisp +++ b/src/code/target-thread.lisp @@ -203,7 +203,7 @@ time we reacquire LOCK and return to the caller." ;;;; job control (defvar *background-threads-wait-for-debugger* t) -;;; may be T, NIL, or a function called with an fd-stream and thread id +;;; may be T, NIL, or a function called with a stream and thread id ;;; as its two arguments, returning NIl or T ;;; called from top of invoke-debugger @@ -213,12 +213,11 @@ already the foreground thread, or transfers control to the first applicable restart if *BACKGROUND-THREADS-WAIT-FOR-DEBUGGER* says to do that instead" (let* ((wait-p *background-threads-wait-for-debugger*) (*background-threads-wait-for-debugger* nil) - (fd-stream (sb!impl::get-underlying-stream stream :input)) (lock *session-lock*)) (when (not (eql (mutex-value lock) (CURRENT-THREAD-ID))) (when (functionp wait-p) (setf wait-p - (funcall wait-p fd-stream (CURRENT-THREAD-ID)))) + (funcall wait-p stream (CURRENT-THREAD-ID)))) (cond (wait-p (get-foreground)) (t (invoke-restart (car (compute-restarts)))))))) diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index 3c5e7e7..10f56e1 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -42,6 +42,12 @@ #include "genesis/vector.h" #include "genesis/weak-pointer.h" #include "genesis/simple-fun.h" + +#ifdef LISP_FEATURE_SB_THREAD +#include +#include /* threading is presently linux-only */ +#endif + /* assembly language stub that executes trap_PendingInterrupt */ void do_pending_interrupt(void); diff --git a/src/runtime/globals.c b/src/runtime/globals.c index b55aecd..7cf1139 100644 --- a/src/runtime/globals.c +++ b/src/runtime/globals.c @@ -41,6 +41,11 @@ lispobj *dynamic_space_free_pointer; lispobj *current_auto_gc_trigger; #endif +#ifdef LISP_FEATURE_SB_THREAD +pid_t parent_pid; +boolean stop_the_world=0; +#endif + /* For copying GCs, this points to the start of the dynamic space * currently in use (that will become the from_space when the next GC * is done). For the GENCGC, it always points to DYNAMIC_SPACE_START. */ diff --git a/src/runtime/globals.h b/src/runtime/globals.h index baff01a..13a0447 100644 --- a/src/runtime/globals.h +++ b/src/runtime/globals.h @@ -35,6 +35,7 @@ extern lispobj *current_auto_gc_trigger; extern lispobj *current_dynamic_space; extern pid_t parent_pid; +extern boolean stop_the_world; extern void globals_init(void); diff --git a/src/runtime/x86-linux-os.c b/src/runtime/x86-linux-os.c index aa1a0ad..460cc9c 100644 --- a/src/runtime/x86-linux-os.c +++ b/src/runtime/x86-linux-os.c @@ -84,7 +84,7 @@ int arch_os_thread_init(struct thread *thread) { if (__modify_ldt (1, &ldt_entry, sizeof (ldt_entry)) != 0) /* modify_ldt call failed: something magical is not happening */ return -1; - __asm__ __volatile__ ("movw %w0, %%gs" : : "q" + __asm__ __volatile__ ("movw %w0, %%fs" : : "q" ((n << 3) /* selector number */ + (1 << 2) /* TI set = LDT */ + 3)); /* privilege level */ @@ -111,7 +111,7 @@ struct thread *arch_os_get_current_thread() { #ifdef LISP_FEATURE_SB_THREAD register struct thread *me=0; if(all_threads) - __asm__ ("movl %%gs:%c1,%0" : "=r" (me) + __asm__ ("movl %%fs:%c1,%0" : "=r" (me) : "i" (offsetof (struct thread,this))); return me; #else diff --git a/version.lisp-expr b/version.lisp-expr index e4d7f00..9bc52ce 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre8.28" +"0.pre8.29"