[libc++] Remove race condition in std::async
authorLouis Dionne <ldionne@apple.com>
Fri, 24 Aug 2018 14:00:59 +0000 (14:00 +0000)
committerLouis Dionne <ldionne@apple.com>
Fri, 24 Aug 2018 14:00:59 +0000 (14:00 +0000)
commit616ef1863faef8dedf2e6bfbaee7569d84f11e35
tree1605d2b26c8b01156a179ee6f223643b5b89eeba
parent689bf93b2ff10ee1d94249274353bb819618a16d
[libc++] Remove race condition in std::async

Summary:
The state associated to the future was set in one thread (with synchronization)
but read in another thread without synchronization, which led to a data race.

https://bugs.llvm.org/show_bug.cgi?id=38181
rdar://problem/42548261

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D51170

llvm-svn: 340608
libcxx/include/future
libcxx/src/future.cpp
libcxx/test/std/thread/futures/futures.async/async_race.38682.pass.cpp [new file with mode: 0644]