with-thread-mutex-unlocked
with-thread-timer-stopped
(without-interruption with-thread-events-blocked)
+ without-preemption
without-thread-mutex-lock
yield-current-thread)
(export (runtime interrupt-handler)
(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 (threads-list)
(map-over-population thread-population (lambda (thread) thread)))