From 1d27bbbb8d65b218f5c6cb7f9c4e2f4f043b30ad Mon Sep 17 00:00:00 2001 From: neevek Date: Mon, 27 Jun 2016 22:41:29 +0800 Subject: [PATCH] doc: add a note on safe reuse of uv_write_t MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Saúl Ibarra Corretgé --- docs/src/stream.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/src/stream.rst b/docs/src/stream.rst index dfcad0fa..7989cd4f 100644 --- a/docs/src/stream.rst +++ b/docs/src/stream.rst @@ -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)