[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] ##sys#timeout-list
From: |
F. Wittenberger |
Subject: |
[Chicken-users] ##sys#timeout-list |
Date: |
Sat, 06 Sep 2008 16:33:43 +0200 |
Hi all,
I've been wondering why the ##sys#timeout-list contained so many
entries.
In scheduler.scm I found (##sys#delq t ##sys#timeout-list) - but that
should not remove any threads from ##sys#timeout-list since the latter
is a list of pairs (<timeout> . <thread>). This diff should do a better
job:
===================================================================
--- scheduler.scm (Revision 11892)
+++ scheduler.scm (Arbeitskopie)
@@ -438,7 +478,12 @@
(define (##sys#thread-unblock! t)
(when (eq? 'blocked (##sys#slot t 3))
- (set! ##sys#timeout-list (##sys#delq t ##sys#timeout-list))
+ (set! ##sys#timeout-list
+ (let loop ((l ##sys#timeout-list))
+ (if (null? l) l
+ (if (eq? (##sys#slot (##sys#slot l 0) 1) t)
+ (##sys#slot l 1)
+ (loop (##sys#slot l 1))))))
(set! ##sys#fd-list
(let loop ([fdl ##sys#fd-list])
(if (null? fdl)
(Be prepared that the diff is from my local copy, which still contains
the code to handle bad fd's in the scheduler - so line number might
vary.)
Best regards
/Jörg
- [Chicken-users] ##sys#timeout-list,
F. Wittenberger <=