Changeset 13375 in project


Ignore:
Timestamp:
02/21/09 08:38:21 (11 years ago)
Author:
Jim Ursetto
Message:

sendfile: release/4: properly handle EAGAIN

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/sendfile/trunk/sendfile.scm

    r12000 r13375  
    252252                 (new-offset (%sendfile-implementation src dst offset next-chunk)))
    253253            (cond
    254              ;;TODO yield control to other threads if new-offset is -2
     254             ((eqv? -2.0 new-offset)  ; EAGAIN/EINTR
     255              (when (write-timeout)
     256                (##sys#thread-block-for-timeout!
     257                 ##sys#current-thread
     258                 (fx+ (##sys#fudge 16) write-timeout)))
     259              (##sys#thread-block-for-i/o! ##sys#current-thread dst #f)
     260              (%yield)
     261              (when (##sys#slot ##sys#current-thread 13)
     262                (%error "write operation timed out"))
     263              (loop offset))
    255264             ((negative? new-offset)
    256265              (##sys#update-errno)
Note: See TracChangeset for help on using the changeset viewer.