I think what's happening is that you are trying to use functions that are Windows specific, as GetAsyncKeyState().
I suggest you to take a look at the following links that might help you:
Also, you could use an Edison's pin to set an interrupt, you could use an interruption instead as a keystroke, mraa has a function for interruptions. Take a look at it, it may interest you:
I will look into those solutions.
I found that I did not need to use the atomic boolean or the boost library. I was able to complete my task with just std::thread with the help of romankubanek's post:
Thank you for the help,