Scope of disable fork

In reply to dave_59:

In reply to tongwang:
disable fork only kills the processes that are children of the process that executes the disable fork statement. It might help to describe the process tree rather than scopes.
process1 calls my_task. The first statement is a fork/join_any. That suspends process1 until any one of the forked processes it creates ends. It it has two statements and creates two child processes, process2 and process3. One of those processes must end before continuing beyond the join_any. Let’s assume process3 ends, so process2 remains.
The next statement is a fork/join. That suspends process1 again until all the processes it creates ends. It contains one statement, so it creates one process4. Now process1 has two children, process2/4. Process4 contains a fork/join_any with two statements. It creates tow child processes, process5/6. One of those processes must end before continuing beyond the join_any. Let’s assume process5 ends, so process6 remains. Now process4 continues executing the disable fork statement. Only process6 is a child of process4, so only that process gets disabled. That is also the last statement in process4, so that process ends and the join can continue process1. When we get to the end of the task, process2 is still a child of process1

Then if i use ‘disable sec_fork’ instead of ‘disable fork’, can i get a same result since task3 and task4 are children processes of sec_fork_guard which executes ‘disable sec_fork’ statement

Thanks.