Communicating between threads in a game program

In my C++ game program, how do I write a function that accepts an input per turn from a bot running on a separate thread? The function should update the game state immediately upon receiving the input but will wait no more than x seconds.

Or, using tools such as events, messages, mail boxes, semaphores, shared memory, others, how can I achieve this?
A global variable named UpdateGameState... Change the value, force update...

bool UpdateGameState =false;
Topic archived. No new replies allowed.