In reply to surya_mudgal:
I think that you are getting an infinite loop in sequence1. The sequence1 forever loop has no blocking construct when flag == 0, so when it executes, there is nothing that allows sequence2 to execute.
In reply to surya_mudgal:
I think that you are getting an infinite loop in sequence1. The sequence1 forever loop has no blocking construct when flag == 0, so when it executes, there is nothing that allows sequence2 to execute.