How to know the sequence is already finished

I created two tasks and both of them will randomly call the sqr to start the same sequence. So at a certain point, it will report the error :
UVM_FATAL @ 2281000000: uvm_test_top.my_env.my_agt.my_sqr@@my_seq [SEQ_NOT_DONE] Sequence uvm_test_top.my_env.my_agt.my_sqr.my_seq already started

So I need to avoid this kind of situation but I wonder if there is a way to know the last sequence is already finished ?

In reply to zz8318:

Did you mean to say both tasks “call the seq.start() method”? Would it work if you had two different instances of the same sequence? What about lock() and unlock()? I guess you need to explain what you want to happen if the other task is not finished with the sequence.

In reply to dave_59:

Hi Dave,

I got the same issue.
I create two sequences, randomize one sequence and copy it to other sequence and tweak just one variable.
By copy, I do simple assignment (no deep copy etc.).
sequence S[2];
// create, randomize S[0].
S[1]= S[0];
S[1].dir = !S[0].dir;

I run S[1] and S[0] on two different sequencers. Sequences complete. I can see their STATE as FINISHED in sequencer viewer (I am not using Mentor tool chain).

The problem happens if I run both S[1] and S[0] in fork join.
fork
S[0].start(SEQR1);
S[1].start(SEQR2);
join_none

On doing single stepping, I see S[0].start executed first and S[0] state changes to PRE_START.
But, when S[1] starts, its state is already at PRE_START and hence the error. But, the sequence in error message is not S[1] but S[0] and the sequencer is SEQR2 (here agent[25]) which is puzzling for me.

UVM_FATAL @105488.00 ns: [SEQ_NOT_DONE ] Sequence uvm_test_top.m_mcu_env.m_mcu_gpio_env.agent[25].sequencer.S[0] already started

This problem does not happen if I do not copy S[0] to S[1] and randomize them separately.

Can you give some clue on what happens related to sequencer when sequences are assigned like I did?