Ignore:
Timestamp:
Nov 8, 2007, 9:30:14 AM (14 years ago)
Author:
gb
Message:

Make sure that CCL::PIPE and CCL::FD-OPEN try to force finalization if
they run out of FDs.

Push new entries on the finalization queue via CCL::ATOMIC-PUSH-UVECTOR-CELL.
Defer GC when deleting entries from the finalization queue in
CANCEL-TERMINATE-WHEN-UNREACHABLE.

"canonicalize" the foreign type (:ARRAY :INT 2); using it would make the
code for CCL::PIPE a little clearer, but there are bootstrapping issues.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0710/ccl/level-0/l0-io.lisp

    r7393 r7611  
    172172(defun fd-open (path flags &optional (create-mode #o666))
    173173  (#+darwin-target with-utf-8-cstrs #-darwin-target with-cstrs ((p path))
    174     (syscall syscalls::open p flags create-mode)))
     174    (let* ((fd (syscall syscalls::open p flags create-mode)))
     175      (declare (fixnum fd))
     176      (when (or (= fd (- #$EMFILE))
     177                (= fd (- #$EMFILE)))
     178        (gc)
     179        (drain-termination-queue)
     180        (setq fd (syscall syscalls::open p flags create-mode)))
     181      fd)))
    175182
    176183(defun fd-chmod (fd mode)
Note: See TracChangeset for help on using the changeset viewer.