I think I found the real issue. The mutex obviously needs to live longer than the lambda that's locking/unlocking it. But that's not guaranteed because the lambda runs in a different thread. Using static provides the guarantee, but it's a bit of a hack. I'll try to propose a more correct solution.
I think I found the real issue. The mutex obviously needs to live longer than the lambda that's locking/unlocking it. But that's not guaranteed because the lambda runs in a different thread. Using static provides the guarantee, but it's a bit of a hack. I'll try to propose a more correct solution.