1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-09 21:40:33 +02:00

ice-9/poll optimization

* module/ice-9/poll.scm (poll-set-add!): Use fileno instead of
  port->fdes, to avoid manipulating revealed counts.
This commit is contained in:
Andy Wingo 2012-02-19 13:29:59 +01:00
parent 8dfb7bbfd9
commit bc1bc9e320

View file

@ -1,6 +1,6 @@
;; poll
;;;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
;;;; Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@ -139,13 +139,7 @@
(off (pollfd-offset idx))
(fd (if (integer? fd-or-port)
fd-or-port
(port->fdes fd-or-port))))
(if (port? fd-or-port)
;; As we store the port in the fdset, there is no need to
;; increment the revealed count to prevent the fd from being
;; closed by a gc'd port.
(release-port-handle fd-or-port))
(fileno fd-or-port))))
(ensure-pset-size! set (1+ idx))
(bytevector-s32-native-set! (pset-pollfds set) off fd)