projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
28c79fa
)
Add without-preemption.
author
Matt Birkholz
<puck@birchwood-abbey.net>
Fri, 10 Jul 2015 02:30:06 +0000
(19:30 -0700)
committer
Matt Birkholz
<puck@birchwood-abbey.net>
Fri, 10 Jul 2015 02:30:06 +0000
(19:30 -0700)
src/runtime/thread.scm
patch
|
blob
|
history
diff --git
a/src/runtime/thread.scm
b/src/runtime/thread.scm
index 968eb606535207bf567fca5e5b1575b88f2295b4..fb5ed81fb4274e3862a0f277033fa9277ad2783c 100644
(file)
--- a/
src/runtime/thread.scm
+++ b/
src/runtime/thread.scm
@@
-85,6
+85,14
@@
USA.
(%outf-error "with-obarray-lock: unlock failed")))
(%outf-error "with-obarray-lock: lock failed"))))
(without-interrupts thunk)))
+
+(define (without-preemption thunk)
+ (let* ((thread first-running-thread)
+ (state (thread/execution-state thread)))
+ (set-thread/execution-state! thread 'RUNNING-WITHOUT-PREEMPTION)
+ (let ((value (thunk)))
+ (set-thread/execution-state! thread state)
+ value)))
\f
(define-structure (thread
(constructor %make-thread (properties))