diff --git a/debian/changelog b/debian/changelog index 1b55d04..3d593b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,21 @@ +chicken (4.5.6-0.2) unstable; urgency=low + + * New upstream version + + -- Joerg F. Wittenberger Thu, 24 Jul 2010 13:41:00 +0200 + +chicken (4.5.6-0.1) unstable; urgency=low + + * New upstream version + + -- Joerg F. Wittenberger Thu, 11 Jul 2010 16:39:00 +0200 + +chicken (4.5.2-0.1) unstable; urgency=low + + * New upstream version + + -- Joerg F. Wittenberger Thu, 11 Jun 2010 14:17:00 +0200 + chicken (4.3.7-0.1) unstable; urgency=low * New upstream version diff --git a/debian/chicken-bin.files b/debian/chicken-bin.files deleted file mode 100644 index e69de29..0000000 diff --git a/files.scm b/files.scm index 9fbc27d..2c1c167 100644 --- a/files.scm +++ b/files.scm @@ -259,7 +259,7 @@ EOF (if (absolute-pathname? dir) dir (##sys#string-append def-pds dir)) ) - file ext pds) ) ) ) + file ext def-pds) ) ) ) (define decompose-pathname (let ((string-match string-match)) diff --git a/library.scm b/library.scm index 26662c5..57424db 100644 --- a/library.scm +++ b/library.scm @@ -3933,17 +3933,6 @@ EOF #f ; #5 locked (##core#undefined) ) ) ; #6 specific -(define (##sys#abandon-mutexes thread) - (let ([ms (##sys#slot thread 8)]) - (unless (null? ms) - (##sys#for-each - (lambda (m) - (##sys#setislot m 2 #f) - (##sys#setislot m 4 #t) - (##sys#setislot m 5 #f) - (##sys#setislot m 3 '()) ) - ms) ) ) ) - (define (##sys#schedule) ((##sys#slot ##sys#current-thread 1))) (define (##sys#thread-yield!) diff --git a/scheduler.scm b/scheduler.scm index 190ee34..fbedb10 100644 --- a/scheduler.scm +++ b/scheduler.scm @@ -38,7 +38,7 @@ ##sys#remove-from-ready-queue ##sys#unblock-threads-for-i/o ##sys#force-primordial ##sys#fdset-input-set ##sys#fdset-output-set ##sys#fdset-clear ##sys#fdset-select-timeout ##sys#fdset-restore - ##sys#clear-i/o-state-for-thread! + ##sys#clear-i/o-state-for-thread! ##sys#abandon-mutexes make-int-priority-queue-entry int-priority-queue-entry? int-priority-queue-color int-priority-queue-color-set! @@ -426,10 +426,35 @@ EOF (##sys#setislot t 13 #f) (##sys#setslot t 11 t2) ) ) ) +(define (##sys#abandon-mutexes thread) + (let ([ms (##sys#slot thread 8)]) + (unless (null? ms) + (##sys#for-each + (lambda (m) + (##sys#setislot m 2 #f) + (##sys#setislot m 4 #t) + (##sys#setislot m 5 #f) + (let ([wts (##sys#slot m 3)]) + (unless (null? wts) + (for-each + (lambda (t2) + (dbg " unblocking: " t2) + (##sys#thread-basic-unblock! t2) ) + wts) ) ) + (##sys#setislot m 3 '()) ) + ms) ) ) ) + (define (##sys#thread-kill! t s) (dbg "killing: " t " -> " s ", recipients: " (##sys#slot t 12)) (##sys#abandon-mutexes t) + (let ([blocked (##sys#slot t 11)]) + (cond + ((##sys#structure? blocked 'condition-variable) + (##sys#setslot blocked 2 (##sys#delq thread (##sys#slot blocked 2)))) + ((##sys#structure? blocked 'thread) + (##sys#setslot blocked 12 (##sys#delq thread (##sys#slot blocked 12))))) ) (##sys#remove-from-timeout-list t) + (##sys#clear-i/o-state-for-thread! t) (##sys#setslot t 3 s) (##sys#setislot t 4 #f) (##sys#setislot t 11 #f) @@ -726,5 +751,4 @@ EOF (when (or (eq? 'blocked (##sys#slot t 3)) (eq? 'sleeping (##sys#slot t 3))) (##sys#remove-from-timeout-list t) (##sys#clear-i/o-state-for-thread! t) - (##sys#setislot t 12 '()) (##sys#thread-basic-unblock! t) ) ) diff --git a/srfi-18.scm b/srfi-18.scm index c857c30..52adb0c 100644 --- a/srfi-18.scm +++ b/srfi-18.scm @@ -307,8 +307,7 @@ EOF (let* ([limitsup (pair? ms-and-t)] [limit (and limitsup (##sys#compute-time-limit (car ms-and-t)))] [threadsup (fx> (length ms-and-t) 1)] - [thread (and threadsup (cadr ms-and-t))] - [abd (##sys#slot mutex 4)] ) + [thread (and threadsup (cadr ms-and-t))] ) (when thread (##sys#check-structure thread 'thread 'mutex-lock!)) (##sys#call-with-current-continuation (lambda (return) @@ -317,7 +316,7 @@ EOF (##sys#setslot mutex 3 (##sys#append (##sys#slot mutex 3) (list ct))) (##sys#schedule) ) (define (check) - (when abd + (when (##sys#slot mutex 4) ; abandoned (return (##sys#signal (##sys#make-structure 'condition '(abandoned-mutex-exception) '()))) ) ) (dbg ct ": locking " mutex) (cond [(not (##sys#slot mutex 5)) @@ -344,6 +343,7 @@ EOF (##sys#setslot mutex 3 (##sys#delq ct (##sys#slot mutex 3))) (unless (##sys#slot ct 13) ; not unblocked by timeout (##sys#remove-from-timeout-list ct)) + (check) (##sys#setslot ct 8 (cons mutex (##sys#slot ct 8))) (##sys#setslot ct 11 #f) (##sys#setslot mutex 2 thread) @@ -353,7 +353,7 @@ EOF [else (##sys#setslot ct 3 'sleeping) (##sys#setslot ct 11 mutex) - (##sys#setslot ct 1 (lambda () (return #t))) + (##sys#setslot ct 1 (lambda () (check) (return #t))) (switch) ] ) ) ) ) ) ) ) (define mutex-unlock! @@ -370,7 +370,8 @@ EOF [limit (and timeout (##sys#compute-time-limit timeout))] ) (##sys#setislot mutex 4 #f) (##sys#setislot mutex 5 #f) - (##sys#setslot ct 8 (##sys#delq mutex (##sys#slot ct 8))) + (let ((t (##sys#slot mutex 2))) + (##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) @@ -467,7 +468,9 @@ EOF ((##sys#structure? blocked 'condition-variable) (##sys#setslot blocked 2 (##sys#delq thread (##sys#slot blocked 2)))) ((##sys#structure? blocked 'mutex) - (##sys#setslot blocked 3 (##sys#delq thread (##sys#slot blocked 3))))) + (##sys#setslot blocked 3 (##sys#delq thread (##sys#slot blocked 3)))) + ((##sys#structure? blocked 'thread) + (##sys#setslot blocked 12 (##sys#delq thread (##sys#slot blocked 12))))) (##sys#setslot thread 1 (lambda ()