Files
swift-mirror/stdlib/public/Concurrency/TaskGroup.cpp
Kavon Farvardin 69e80a1201 use compare_exchange_strong to protect agianst spurious failures
A `compare_exchange_weak` can spuriously return false, regardless of
whether a concurrent access happened. This was causing a null-pointer
dereference in TaskGroupImpl::poll in a narrow circumstance.

The dereference failure only appears when using the `arm64`
slice of the runtime library, since Clang will use `ldxr/stxr` for
synchronization on such targets. The weak form does not retry on a
spurious failure, but the strong version will.

resolves rdar://84192672
2021-11-18 16:37:04 -08:00

32 KiB