Fork join_any runs in the background. How to stop that

Hi Dave,
Thanks for the response.

yes their are multiple wait statements in each task waiting for the same condition. I am not using ; after the wait statement.


module top;
// clk generation 

b<=1'b1; 
c<=1'b1; 
endmodule 

task A;
fork 
wait(condition=b) begin 
B; 
end
wait(condition=c) begin 
C;
end
wait(condition=d) begin 
D;
end 
join_any
endtask  

task B;
fork
wait(condition=c) begin 
C1;
end
wait(condition=d) begin 
D;
end
wait(condition=e) begin 
E;
end 
join_any
endtask 


Here in the top I am driving b=1’b1 so wait statement is satisfied and it will go to task B. Then i am driving c=1’b1 so it is expected that as it is task B it will make task B’s condition=c and call the task C1 and not the task A’s condition=c and execute that C. If I tried doing the disable fork in the task A it does not proceed to task B and kill everything.So i want to use disable fork so that it should not go to task A and satisfy that condition. I am using +UVM_TIMEOUT as I have multiple wait statements.
Thanks.