I am having a problem modeling one specific use case.
- Task 1 and task 2 are generated in parallel.
- Task 1 is repeated several times depending on the condition.
- As soon as the first task 1 is completed, we must wait until the completion of task 2 before continuing. This means that the first iteration of task 1 will wait (if task 2 has not yet been completed), but subsequent iterations will continue, since task 2 has already been completed.
Here is my simulation attempt:

The problems that I see with this model are:
1- If Task 2 is completed before the completion of the first Task 1, the Event will be thrown, but not caught. And once Task 1 is completed, he will wait for the event indefinitely.
2- 2+ 1 , .
, , , !