fiber icon indicating copy to clipboard operation
fiber copied to clipboard

Why `fiber::mutex` yields in `try_lock` even after acquiring the lock successfully?

Open rodman10 opened this issue 8 months ago • 0 comments

Recently I'm reading the source code of fiber::mutex, I noticed thatfiber::mutex will yield in try_lock no matter whether holding the lock or not? What's the considerations behind it, and can we just return immediately after lock? Thanks in advance. https://github.com/boostorg/fiber/blob/238487b543e8863c647d31a82ccfc3fa11a960d9/src/mutex.cpp#L43-L60

rodman10 avatar May 06 '25 09:05 rodman10