#| -*-Scheme-*-
-$Id: thread.scm,v 1.49 2008/02/15 04:19:00 riastradh Exp $
+$Id: thread.scm,v 1.50 2008/09/12 10:26:18 riastradh Exp $
Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
((READ/WRITE) (lambda (mode) mode))
((ERROR HANGUP) (lambda (mode) mode #t))
(else (error "Illegal mode:" mode))))))
- (let ((tentry (dentry/first-tentry dentry)))
- (let ((events
- (cons (cons (tentry/thread tentry)
- (let ((e (tentry/event tentry)))
- (and e
- (lambda () (e mode)))))
- events)))
- (if (tentry/permanent? tentry)
- (move-tentry-to-back! tentry)
- (delete-tentry! tentry))
- (loop (fix:+ i 1) events)))))
+ (if (not dentry)
+ (loop (fix:+ i 1) events)
+ (let ((tentry (dentry/first-tentry dentry)))
+ (let ((events
+ (cons (cons (tentry/thread tentry)
+ (let ((e (tentry/event tentry)))
+ (and e
+ (lambda () (e mode)))))
+ events)))
+ (if (tentry/permanent? tentry)
+ (move-tentry-to-back! tentry)
+ (delete-tentry! tentry))
+ (loop (fix:+ i 1) events))))))
(do ((events events (cdr events)))
((not (pair? events)))
(%signal-thread-event (caar events) (cdar events)))))))