libuv/include
Saúl Ibarra Corretgé 78a1cd167f win,async: refactor internal implementation
- Use atomic ops both to set and reset async_sent flag
- Remove the MinGW atomic ops, since Windows intrinsics are supported
- Remone thread-unsafe checks from uv_async_send

According to MSDN there are no alignment requirements. We could use
InterlockedExchange8, but that's only available on Windows >= 8.

This change is intended to make uv_async_send more resilient. It has to
be thread-safe, and that means that the handle could just have been
closed when uv_async_send was called. This case was previously not
handles (there is an inherent race condition). The new model is inspired
by the one used on the Unix side, which uses a single fd (or overlapped
in this case) to wakeup the loop and then process all pending async
handles. This makes handling those edge cases a lot simpler: when the
handle is closed it's removed from the handle queue, and then it's not
processed at all.

As a result of this change, async benchmarks work on Windows where they
previously failed with assertions.

PR-URL: https://github.com/libuv/libuv/pull/980
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-08-09 13:12:41 +01:00
..
android-ifaddrs.h android: add support of ifaddrs in android 2014-03-16 23:16:25 +01:00
pthread-barrier.h unix: remove 1.x-compat code from fallback barrier 2016-05-18 23:07:24 +02:00
tree.h build: switch to autotools 2013-07-02 01:21:16 +02:00
uv-aix.h aix: improve AIX compatibility 2014-07-22 22:57:24 +02:00
uv-bsd.h unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
uv-darwin.h unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
uv-errno.h unix, windows: map EHOSTDOWN errno 2015-02-19 15:38:12 +01:00
uv-linux.h unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
uv-sunos.h unix, windows: remove unneeded define 2014-05-08 09:08:33 +02:00
uv-threadpool.h unix, windows: use the same threadpool implementation 2014-06-27 14:27:04 +02:00
uv-unix.h unix: fix bug in barrier fallback implementation 2016-04-26 09:35:47 +02:00
uv-version.h Now working on version 2.0.0 2016-05-18 23:06:48 +02:00
uv-win.h win,async: refactor internal implementation 2016-08-09 13:12:41 +01:00
uv.h win,build: drop support for Visual Studio < 2015 2016-08-04 12:02:38 +01:00