Am 29.06.23 um 20:17 schrieb Foelsche, Peter via Boost:
On windows flyweight simple_locking is using std::mutex but it should be using std::recursive_mutex.
I've checked by implementing my own locking policy and it definitely shows that the code is attempting to hold more than a single lock in parallel on the same mutex. Does this mean you don't use `simple_locking` but a custom locking
Are you referring to https://github.com/boostorg/flyweight/blob/develop/include/boost/flyweight/s... I was confused that this Boost lib would be using the std-variants of the locking classes not the Boost ones so I checked it. And indeed I can't see any reference to `std::mutex`. Instead `simple_locking` uses `recursive_lightweight_mutex` a custom mutex that IS recursive. policy which uses `std::mutex`? Then I'd say this is a mistake on your side. I also double-checked the documentation which states
The type |Locking::mutex_type| (or |Locking'::mutex_type| if (b) applies) is a model of |Mutex| and supports recursive locking.
So change the `std::mutex` in your custom locking policy to use `std::recursive_mutex`, or clarify if I misinterpreted anything. Hope that helps Alex