diff options
author | Justin Berger <j.david.berger@gmail.com> | 2017-07-27 13:11:07 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-29 21:36:31 (GMT) |
commit | a3abb85c6ff5aebe2220ae612512a434b491eedd (patch) | |
tree | 155409d97d1bca65c774c999c56e1f171ab0a3ad /Tests | |
parent | 90f8db269fcc6978badd93b5f985dee2e01feab3 (diff) | |
download | CMake-a3abb85c6ff5aebe2220ae612512a434b491eedd.zip CMake-a3abb85c6ff5aebe2220ae612512a434b491eedd.tar.gz CMake-a3abb85c6ff5aebe2220ae612512a434b491eedd.tar.bz2 |
Add RAII handles for libuv handle types
The `uv_*_t` handle types are closed by `uv_close`, but the semantics
are tricky. Calling `uv_close` may not close immediately. Instead it
hands ownership to the uv loop to which the handle is currently
attached. When the loop decides to close it, a callback is used to
allow the `uv_close` caller to free resources.
Provide an abstraction layer as `cm::uv_*_ptr` types corresponding to
the `uv_*_t` handle types. Each pointer is either empty (`nullptr`)
or has an initialized handle attached to a loop. Use move semantics
to ensure a single owner of the handle so that clients can predict
when the handle is destroyed.
Diffstat (limited to 'Tests')
0 files changed, 0 insertions, 0 deletions