I am trying to pass a bool flag from the main thread to another thread with lambda function, but it does not seem to work. My idea is to create a
bool
lambda