How to escape in while(1)?

Regarding for understanding, All run_phase tasks in all components get killed when the last objection drops.
https://verificationacademy.com/forums/uvm/how-end-simulation-when-there-are-forever-loops-sequence-and-monitor

I expected the while(1) will be killed when the drop objection.
but as you can see the below code, while(1) was not killed because never meet drop_objection().
So When we use forever statement in raise/drop_objection(), how to escape it? Could you guide me how to deal with forever statement?


 virtual task run_phase(uvm_phase phase);
    phase.raise_objection(this);
        fork begin                                                       
            while(1) begin
                ...
                if(compC.m_analysis_fifo.is_empty) `uvm_info(get_type_name(),"UVM_TLM_ANALYSIS_FIFO compC is Empty", UVM_LOW)                     
                #5;                                                      
            end
        end
       join_any
       disable fork;                                                        
    phase.drop_objection(this);
endtask

In reply to UVM_LOVE:
The following are all equivalent loops.

forever // recommended as this shows the clearest intent 
  begin
    statement;
  end
while(1)
  begin
    statement;
  end
for(;;)
  begin
    statement;
  end
do
  begin
    statement;
  end
  while (1);

There are two ways to escape these loops.

  1. execute a break statement within the loop.
  2. terminate the process executing the loop.

Normally you would not put a raise/drop objection in a phase containing an infinite loop. Some other component like the test would have the calls to raise/drop objection. When there are no more outstanding objections, the UVM terminates all processes in that phase.

In reply to dave_59:

In reply to UVM_LOVE:
The following are all equivalent loops.

forever // recommended as this shows the clearest intent 
begin
statement;
end
while(1)
begin
statement;
end
for(;;)
begin
statement;
end
do
begin
statement;
end
while (1);

There are two ways to escape these loops.

  1. execute a break statement within the loop.
  2. terminate the process executing the loop.

Normally you would not put a raise/drop objection in a phase containing an infinite loop. Some other component like the test would have the calls to raise/drop objection. When there are no more outstanding objections, the UVM terminates all processes in that phase.

Thank you dave.
If you don’t mind would you please let me know the example case of “terminate the process executing the loop.”?