aboutsummaryrefslogtreecommitdiff
path: root/docs/src/sphinx-plugins/manpage.py
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2019-03-26 02:06:32 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2019-04-22 16:22:36 +0200
commit37042a5bca8b392f71d7da6e01457ece5a148e99 (patch)
treedf2f95ab903265171843233d8f33efa3e9de1e11 /docs/src/sphinx-plugins/manpage.py
parent87a116c4d0d4287da06301579773a2a3f6da8da8 (diff)
downloadlibuv-37042a5bca8b392f71d7da6e01457ece5a148e99.tar.gz
libuv-37042a5bca8b392f71d7da6e01457ece5a148e99.zip
unix: fix race condition in uv_async_send()
After inspection of the code, it seems like there is a race window between the cmpxchgi() and uv__async_send() calls. If the event loop thread is already busy looping over the async handles, it can invoke the callback - which in turn can close the handle - before the other thread reaches the uv__async_send() call. That's bad because it accesses the handle that at that point might not be valid anymore. Fix that by introducing an ad hoc spinlock that blocks the event loop thread until the sending thread is done. It's not pretty or elegant but it fixes the immediate bug and appears to have no measurable impact on the async handle benchmarks. Fixes: https://github.com/libuv/libuv/issues/2226 PR-URL: https://github.com/libuv/libuv/pull/2231 Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
Diffstat (limited to 'docs/src/sphinx-plugins/manpage.py')
0 files changed, 0 insertions, 0 deletions