sionescu / iolib

Common Lisp I/O library
http://common-lisp.net/project/iolib/
MIT License
141 stars 31 forks source link

bugfix for cascading timeouts in event loop #4

Closed ghost closed 12 years ago

ghost commented 12 years ago

Timeouts weren't getting cleaned up. Use case:

(loop (event-dispatch event-loop :one-shot t :timeout whatever))

event-dispatch gets called once, creates timeout A. FD event occurs, leaving A active. Call again to create timeout B, then timeout A fires leaving B. Call again to create C, B fires... Basically, accumulates a chain of unwanted timeouts for every actual socket event leading to 100% CPU utilization pretty quickly.

Patch tries to address this.

sionescu commented 12 years ago

Thanks, patch committed