- This document provides critical notes for useful Mermaid functionality within GitHub's markdown Syntax.
- Daigrams are only visible after publishing the file; they cannot be viewed using the preview changes option.
graph TD;
A("Instantiate resource")-->B("Perform first action");
B --> C{"Did result satisfy condition?"};
C -- no --> B;
C -- yes --> F("Perform second action");
graph TD;
A("Instantiate resource")-->B("Perform first action");
B --> C{"Did result satisfy condition?"};
C -- no --> B;
C -- yes --> F("Perform second action");
graph TD;
subgraph Thread B
A1("...") --> B1("Call testAndSet(lockValue)\n
Make copy of current lock value\n
Set lockValue to 1\n
return copy")
B1 --> C1{"Is copy == 0?"}
C1 -- no --> B1
C1 -- yes --> D1("Perform action in critical section")
D1 --> E1("Set lockValue to 1")
end
subgraph Thread A
A2("...") --> B2("Call testAndSet(lockValue)\nMake copy of current lock value\nSet lockValue to 1\nreturn copy")
B2 --> C2{"Is copy == 0?"}
C2 -- no --> B2
C2 -- yes --> D2("Perform action in critical section")
D2 --> E2("Set lockValue to 1")
end
graph TD;
subgraph Thread B
A1("...") -- approaching critical section --> B1("Call testAndSet(lockValue)<br/>Make copy of current lock value<br/>Set lockValue to 1<br/>return copy")
B1 --> C1{"Is copy == 0?"}
C1 -- no --> B1
C1 -- yes --> D1("Perform action in critical section")
D1 --> E1("Set lockValue to 1")
E1 --> F1("...")
end
subgraph Thread A
A2("...") -- approaching critical section --> B2("Call testAndSet(lockValue)<br/>Make copy of current lock value<br/>Set lockValue to 1<br/>return copy")
B2 --> C2{"Is copy == 0?"}
C2 -- no --> B2
C2 -- yes --> D2("Perform action in critical section<br>")
D2 --> E2("Set lockValue to 1")
E2 --> F2("...")
end