Punt without-preemption; use without-interrupts during callouts.
authorMatt Birkholz <puck@birchwood-abbey.net>
Tue, 5 Jan 2016 09:46:36 +0000 (02:46 -0700)
committerMatt Birkholz <puck@birchwood-abbey.net>
Tue, 5 Jan 2016 09:46:36 +0000 (02:46 -0700)
Its use in (runtime ffi) causes timer interrupts to be ignored --
completely ignored in the glxgears demo's animation loop.  It is
probably no more helpful in with-obarray-lock(?).

src/gl/gl-glxgears.scm
src/gl/gl.scm
src/runtime/ffi.scm
src/runtime/runtime.pkg
src/runtime/thread.scm

index eafae92eedc78148b47361eb43fa6e17a286cd41..f725055eeefb6dcb722da200b10e98f4d385ea03 100644 (file)
@@ -198,7 +198,7 @@ USA.
                (let loop ()
 
                  ;; Sleep when not realized?, not animate?, or obscured.
-                 (without-interrupts
+                 (with-thread-events-blocked
                   (lambda ()
                     (let ((visibility (glxgears-demo-visibility widget)))
                       (if (or (not (glxgears-demo-realized? widget))
index d77326ced6eee0bbe1923a34d2b89f1c4b32e227..0a6475a8290c5d9761679d3c575d50def47edf99 100644 (file)
@@ -387,7 +387,7 @@ USA.
   (init))
 
 (define (with-gl-library thunk)
-  (with-thread-mutex-locked gl-library-mutex thunk))
+  (with-thread-mutex-lock gl-library-mutex thunk))
 
 (define (guarantee-current operator)
   (if (not (eq? (current-thread)
index 0484ac535a126973efe1b84d2e572204da18dc3e..55025e58c0eec1b54124fbc5d8992a0d7b2d796f 100644 (file)
@@ -313,7 +313,7 @@ USA.
      (if (alien-function? arg)
         (alien-function-cache! arg)))
    args)
-  (without-preemption
+  (without-interrupts
    (lambda ()
      (call-alien* alien-function args))))
 
index 43a57fca3445a7f175eb80b8145f21091c450904..7b9a99b0275b3359625f5c4ada95ab9a934fdac2 100644 (file)
@@ -5112,7 +5112,6 @@ USA.
          with-thread-mutex-unlocked
          with-thread-timer-stopped
          (without-interruption with-thread-events-blocked)
-         without-preemption
          without-thread-mutex-lock
          yield-current-thread)
   (import (runtime population)
index f3eee99ddfba29b17eb151e72e8f397712ed3fdc..ac7d5dc4fe10a6f7bfd3a182df1b4cc47f5e7794 100644 (file)
@@ -172,19 +172,11 @@ USA.
       (set-interrupt-enables! interrupt-mask)
       value)))
 
-(define (without-preemption thunk)
-  (let* ((thread (current-thread))
-        (state (thread/execution-state thread)))
-    (set-thread/execution-state! thread 'RUNNING-WITHOUT-PREEMPTION)
-    (let ((value (thunk)))
-      (set-thread/execution-state! thread state)
-      value)))
-
 (define (with-obarray-lock thunk)
   ;; Serialize with myriad parts of the microcode that hack the
   ;; obarray element of the fixed-objects vector.
   (if enable-smp?
-      (without-preemption
+      (without-interrupts
        (lambda ()
         (if (not (eq? #t ((ucode-primitive smp-lock-obarray 1) #t)))
             (outf-error "\nwith-obarray-lock: lock failed\n"))
@@ -192,10 +184,7 @@ USA.
           (if (not (eq? #t ((ucode-primitive smp-lock-obarray 1) #f)))
               (outf-error "\nwith-obarray-lock: unlock failed\n"))
           value)))
-      (let* ((mask (set-interrupt-enables! interrupt-mask/gc-ok))
-            (value (thunk)))
-       (set-interrupt-enables! mask)
-       value)))
+      (without-interrupts thunk)))
 
 (define (threads-list)
   (map-over-population thread-population (lambda (thread) thread)))