I am getting a debug abort when I try to use std::lock_guard

Friesen, Stanley 21 Reputation points
2021-06-14T21:11:25.223+00:00

I am unable to determine the cause of a debug abort in the std::lock_guard constructor. _Mtx_lock() is returning a value of 3. I have no idea what that means.
In the class definition I have a member declared:
std::mutex _mutex;
In a member function I have:
std::lock_guard lck(_mutex);

I have verified that the constructor for my class is being called, so the mutex should have been initialized.

How do I determine how to fix my code?

Developer technologies | C++
0 comments No comments
{count} votes

Accepted answer
  1. RLWA32 49,541 Reputation points
    2021-06-15T00:49:51.89+00:00

    Maybe the problem is something like what was described here - https://stackoverflow.com/questions/30741114/stdmutexlock-fails-on-windows-error-code-3


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.