Prevent task switching during specific code execution

Hi,
I have a very small piece (literally just few lines) of code that I want to ensure is fully executed without being interrupted by task switching.
What is the best/correct way to do it?
Is vTaskSuspendAll() the way?
Thank you
Rick

This is a pretty good thread when to use which tool for mutual exclusion:

In case you simply want to have the code executed as fast as possible and deterministically i.e. without any interruption you have to use a critical section.
If you’re using interrupts outside FreeRTOS covered (priority) range you might want disable interrupts globally e.g. using __disable/enable_irq intrinsics for ARM MCUs.