Scope of disable fork

In reply to dave_59:

In reply to yakirye:
Yes, what you wrote works under one condition—there is only one invocation of my_task. If there are multiple invocations, disable sec_fork kills all of them.

Hello Dave,

I have one question for ‘multiple invocations’ you mentioned.

If this task belongs to one component and we have multiple objects of this components, like below:


    comp  c0, c1, c2;
    c0 = new();
    c1 = new();
    c2 = new();

    fork
        c0.my_task();
        c1.my_task();
        c2.my_task();
    join
......

Does this mean ‘multiple invocations’ in your case? how can we just kill those threads(task3/4)inside c2 instead of all rests even in C0 and C1, if so.

Thanks!