Any mandator rule that "voluteer yield" operation should or should not in critical section?

Hi folks:
from the portyield call called positon,it seems there are no directly relationship for the vPortYield called with or without interrupt disabled.
for example:
taskYIELD_IF_USING_PREEMPTION called in prvAddNewTaskToReadyList are with the EXIT CRITICAL was called before, this means the yield opeartion execution in preemptive context.
but in many others cases, the taskYIELD_IF_USING_PREEMPTION are called in critical section.

so this means, there is no a general principle that volunteer yield are held?
thank you.

As a general rule application code should [edit] NOT [/edit] yield from inside a critical section. That is in part because the behaviour of doing so will depend on the port you are using. Sometimes the yield will occur immediately (such as with ARMv4 architectures), sometimes the yield will occur when the critical section exits (such as with ARMv7 architectures). The FreeRTOS kernel does yield from inside critical sections but is designed to work in both cases (in the former case it has to save the critical section nesting depth and interrupt enable status as part of the task context).

thank you very much!