Make thread wait until another thread has changed a variable. How?

I’m new to unreal, but in general, you need some kind of wait/notify mechanism.

In Unreal, I can see the FSemaphore class.

I am not sure from the docs how exactly it is supposed to be used, but generally, the gist is the waiting thread waits on that lock, and the thread that should provide the value should notify the lock when the value is ready, unblocking the waiting thread. But I am not sure if that’s the best solution for you.