29 Jun
2023
29 Jun
'23
6:24 p.m.
On Jun 29, 2023, at 11:17 AM, Foelsche, Peter via Boost
Dear All,
On windows flyweight simple_locking is using std::mutex but it should be using std::recursive_mutex.
I've got this firing an exception due to _Check_C_return() getting passed something else than success (number 3).
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. The secured set.erase() can cause further flyweights to be destroyed given a suitable recursive use of flyweight.
Kind Regards Peter Foelsche
PS. Thanks for boost!
Opened https://github.com/boostorg/flyweight/issues/12 for this issue. — Marshall