I want to create a counter inside a thread, and stop it by changing the value of a boolean.
Here's my code:
using namespace std;
_terminateT = false;
_terminateT = true;
The problem is that the loop is blocked by the
Is there a way to protect the
_terminateT variable without blocking the while loop?