]> git.lizzy.rs Git - rust.git/commit
Rework the idle callback to have a safer interface
authorAlex Crichton <alex@alexcrichton.com>
Wed, 6 Nov 2013 19:38:53 +0000 (11:38 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Sun, 10 Nov 2013 09:37:11 +0000 (01:37 -0800)
commitb545751597a8cdeee4554338318f0ed6339634fd
treee59d2c56af2c4547641b9b83b4b7939ee3a25f0d
parentd08aadcc9aff233165a063df73c6436e0969f79c
Rework the idle callback to have a safer interface

It turns out that the uv implementation would cause use-after-free if the idle
callback was used after the call to `close`, and additionally nothing would ever
really work that well if `start()` were called twice. To change this, the
`start` and `close` methods were removed in favor of specifying the callback at
creation, and allowing destruction to take care of closing the watcher.
src/librustuv/idle.rs
src/librustuv/uvio.rs
src/libstd/rt/basic.rs
src/libstd/rt/rtio.rs
src/libstd/rt/sched.rs