swift
swift copied to clipboard
Adjust the docs for `Mutex.withLockIfAvailable()` re: spurious failures.
This PR adjusts the documentation for Mutex.withLockIfAvailable() to clarify that it is not subject to spurious failures. The C11 and C++11 specs for their respective tryLock() APIs allow for spurious failures, but our implementations and those of every other similar API I've found don't use weak cmpxchgs and don't spuriously fail.
I opened a forum thread here that discusses this change and went into way more detail than was practical explaining why I think we can make this guarantee. 🙂
@swift-ci test
Holding for a check-in with the LSG.