In my program, I have a global static value like this:
static bool done=false
which is taken by callback like this:
Library::CallbackType callback(bool& isDone, par1type& par1,....){
return [&isDone,&par1,...](par0type par0){
if(conditionTrue){
doSomething();
} else {
thread([isDone,par1]()mutable{
cleanUp();
isDone=true;
}).detach():
}
}
}
and the problem is when I call the code:
library->doCallback(callback(done,p1,...));
its code is generally working except the value of done is not changing as I intend.
So, what I got wrong?