I am drawing a quite typical sequence diagram between two threads:
@startuml
participant "Thread #1" as T1 order 10
participant "Thread #2" as T2 order 30
activate T1
note over T1: Initialize
loop Until not needed any more
note over T1: Do something
T1 -->T2: Send start signal
T1-->?: Wait
deactivate T1
hnote over T1: Wait for\nend\nsignal
T1<--?: Wake-up
activate T1
end
T1 -->x?: Exit
deactivate T1
activate T2
note over T2: Initialize
loop Forever
T2-->?: Wait
deactivate T2
hnote over T2: Wait for\nstart\nsignal
T2<--?: Wake-up
activate T2
note over T2: Do something
T2 --> T1: Send end signal
end
T2 -->x?: Exit
deactivate T2
@enduml
Problems:
1) the for loop are extended beyond the participant they are created for
2) The signals should be match the location, where waiting a signal, is there a way to mark anchors or references?
3) deactivation after note do not work, have to have e.g. signal prior deactivation