Date: Wed, 31 May 2023 17:08:35 -0700
On Wednesday, 31 May 2023 16:58:09 PDT Phil Bouchard wrote:
> - The container::empty() could return a temporary object that can be
> converted to a boolean but also locks the internal recursive mutex;
In other words, we need a std::lock_guard or equivalent. How is this different
from a regular mutex? This is a very simple example and yet we've already got
ourselves a mutex and needing to think about which operations need to be
protected so the state doesn't change from under us.
> - The container::empty() could return a temporary object that can be
> converted to a boolean but also locks the internal recursive mutex;
In other words, we need a std::lock_guard or equivalent. How is this different
from a regular mutex? This is a very simple example and yet we've already got
ourselves a mutex and needing to think about which operations need to be
protected so the state doesn't change from under us.
-- Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org Software Architect - Intel DCAI Cloud Engineering
Received on 2023-06-01 00:08:37