Execute code on GameThread

How to execute code on the GameThread?
I’ve tried this:


FGraphEventRef RewardedVideoCompletedTask = FFunctionGraphTask::CreateAndDispatchWhenReady(&]()
    {
        AMyGameGameMode* GameMode = UMyGameBlueprintLibrary::GetCRGameMode(this);
        GameMode->SaveMeFreeCompleted();
    }, TStatId(), NULL, ENamedThreads::GameThread);
    FTaskGraphInterface::Get().WaitUntilTaskCompletes(RewardedVideoCompletedTask);

but it froze my game… Please help me.