boostorg / boostorg/fiber

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

Ouverte
#331 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Langage dominant
C++
Étoiles
510
Forks
123
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Recently I'm reading the source code of `fiber::mutex`, I noticed that`fiber::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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.