Hi , i'm trying to realize a simple code with thread and lambda function.
My goal is to swap 2 variable .
I launch 2 thread,
The first:
Put his value in a shared variable and notify it .
wait until an event on a condition variable occur.
read from shared value .
The second wait until an event on a condition variable occur.
Wake up
read from shared value .
Put his value in a shared variable and notify it.
Guessing what the rest of the code might look like (you really need to post compilable code for someone else to debug it), I believe what you have here is an uncaught exception thrown by unique_lock's constructor, which you're attempting to construct with an already-locked mutex m.