On Aug 27, 2025, at 5:18 PM, Arthur O'Dwyer <arthur.j.odwyer@gmail.com> wrote:
Now, if std::try_lock didn't already have this weird int-returning API, I definitely wouldn't be clamoring for you to add it. It seems like a confusing, PHP-style API to me. But since it does exist, I think arguably we should be consistent with it.
I agree with your comment.
Motivation for the current try_lock API:
The one use case I had for it needed to identify which try_lock failed in order to implement the “smart & polite” algorithm described here: