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:
parent
8dfb7bbfd9
commit
bc1bc9e320
1 changed files with 2 additions and 8 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue