0.pre8.29
authorDaniel Barlow <dan@telent.net>
Wed, 2 Apr 2003 12:46:19 +0000 (12:46 +0000)
committerDaniel Barlow <dan@telent.net>
Wed, 2 Apr 2003 12:46:19 +0000 (12:46 +0000)
   === 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

src/code/target-thread.lisp
src/runtime/gencgc.c
src/runtime/globals.c
src/runtime/globals.h
src/runtime/x86-linux-os.c
version.lisp-expr

index 176336e..0a9ab3b 100644 (file)
@@ -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))))))))
 
index 3c5e7e7..10f56e1 100644 (file)
 #include "genesis/vector.h"
 #include "genesis/weak-pointer.h"
 #include "genesis/simple-fun.h"
+
+#ifdef LISP_FEATURE_SB_THREAD
+#include <sys/ptrace.h>
+#include <linux/user.h>                /* threading is presently linux-only */
+#endif
+
 /* assembly language stub that executes trap_PendingInterrupt */
 void do_pending_interrupt(void);
 
index b55aecd..7cf1139 100644 (file)
@@ -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. */
index baff01a..13a0447 100644 (file)
@@ -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);
 
index aa1a0ad..460cc9c 100644 (file)
@@ -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
index e4d7f00..9bc52ce 100644 (file)
@@ -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"