From 124d4cb348b84da560389d357a363c706af5f5c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20F=2E=20Wittenberger?= Date: Fri, 19 Feb 2016 18:33:56 +0100 Subject: [PATCH] add section markers large enough for "meld" to pick them up --- scheduler.scm | 17 +++++++++++++++++ srfi-18.scm | 13 +++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/scheduler.scm b/scheduler.scm index fa1c2ab..245f400 100644 --- a/scheduler.scm +++ b/scheduler.scm @@ -144,6 +144,23 @@ EOF (syntax-rules () ((_ . _) #f))) +;;; BEGIN NEW SECTION (Integrating old scheduler) +#| +we +need "diff" to find this worth to be kept as is + +dunno what to do + +|# +;;; END NEW SECTION (Integrating old scheduler) + +#| +we +need "diff" to find this worth to be kept as is + +dunno what to do + +|# (define-syntax panic (syntax-rules () ((_ msg) (##core#inline "C_halt" msg)))) diff --git a/srfi-18.scm b/srfi-18.scm index 09888ff..5111531 100644 --- a/srfi-18.scm +++ b/srfi-18.scm @@ -279,7 +279,7 @@ (when (##sys#slot mutex 4) ; abandoned (return (##sys#signal (##sys#make-structure 'condition '(abandoned-mutex-exception) (list (##sys#slot mutex 1))))) ) ) (define (assign) - (##sys#setislot ct 11 #f) + (##sys#setislot ct 11 #f) ;;; FIXME: still required? (check) (if (and threadsup (not thread)) (begin @@ -307,6 +307,7 @@ ct 1 (lambda () (if (##sys#slot ct 13) ; unblocked by timeout + ;;; FIXME: still required? (begin (##sys#setslot mutex 3 (##sys#delq ct (##sys#slot mutex 3))) (##sys#setislot ct 11 #f) @@ -339,7 +340,7 @@ (let ((t (##sys#slot mutex 2))) (when t (##sys#setislot mutex 2 #f) - (##sys#setslot t 8 (##sys#delq mutex (##sys#slot t 8))))) ; unown from owner + (##sys#setslot t 8 (##sys#delq mutex (##sys#slot t 8))))) (when cvar (##sys#setslot cvar 2 (##sys#append (##sys#slot cvar 2) (##sys#list ct))) (##sys#setslot ct 11 cvar) ; block object @@ -369,7 +370,7 @@ (##sys#setslot wt 11 #f) (##sys#add-to-ready-queue wt)) (else - (##sys#error 'mutex-unlock "Internal scheduler error: unknown thread state: " + (##sys#error 'mutex-unlock! "Internal scheduler error: unknown thread state: " wt wts))) ) ) (if (eq? (##sys#slot ct 3) 'running) (return #t) @@ -411,7 +412,7 @@ [t0s (##sys#slot t0 3)] ) (##sys#setslot cvar 2 (##sys#slot ts 1)) (when (or (eq? t0s 'blocked) (eq? t0s 'sleeping)) - (##sys#thread-basic-unblock! t0) ) ) ) ) ) + (##sys#thread-basic-unblock! t0) ) ) ) ) ) ;; TBD (define (condition-variable-broadcast! cvar) (##sys#check-structure cvar 'condition-variable 'condition-variable-broadcast!) @@ -420,14 +421,14 @@ (lambda (ti) (let ([tis (##sys#slot ti 3)]) (when (or (eq? tis 'blocked) (eq? tis 'sleeping)) - (##sys#thread-basic-unblock! ti) ) ) ) + (##sys#thread-basic-unblock! ti) ) ) ) ;; TBD (##sys#slot cvar 2) ) (##sys#setislot cvar 2 '()) ) ;;; Change continuation of thread to signal an exception: -(define (thread-signal! thread exn) +(define (thread-signal! thread exn) ;; TBD (##sys#check-structure thread 'thread 'thread-signal!) (dbg "signal " thread exn) (if (eq? thread ##sys#current-thread) -- 2.6.2