doc: add a note on safe reuse of uv_write_t

uv_write_t can be reused safely only after the callback passed to
uv_write is fired.

PR-URL: https://github.com/libuv/libuv/pull/927
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
This commit is contained in:
neevek 2016-06-27 22:41:29 +08:00 committed by cjihrig
parent 77c8abae33
commit 1d27bbbb8d

View File

@ -26,7 +26,11 @@ Data types
.. c:type:: uv_write_t
Write request type.
Write request type. Careful attention must be paid when reusing objects of
this type. When a stream is in non-blocking mode, write requests sent
with ``uv_write`` will be queued. Reusing objects at this point is undefined
behaviour. It is safe to reuse the ``uv_write_t`` object only after the
callback passed to ``uv_write`` is fired.
.. c:type:: void (*uv_read_cb)(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf)