You can use a AsyncTask to execute code on the GameThread from an other Thread.
Here a sample i use:
FFunctionGraphTask::CreateAndDispatchWhenReady([this]() {
UE_LOG(LogTemp, Warning, TEXT("on gameThread"));
// your code on gamethread
}
, TStatId(), nullptr, ENamedThreads::GameThread);
if you want to test use a sleep in the code and your game should freeze.