1 digraph "design-2.1-lock-acquire" {
2 graph[fontsize=8, fontname="Helvetica"]
3 node[fontsize=8, fontname="Helvetica", width="0", height="0"]
4 edge[fontsize=8, fontname="Helvetica"]
7 abort[label="Abort\n(couldn't acquire)"]
8 acquire[label="Acquire lock"]
9 add_to_queue[label="Add condition to queue"]
10 wait[label="Wait for notification"]
11 remove_from_queue[label="Remove from queue"]
14 alone[label="Empty queue and can acquire?", shape=diamond]
15 have_timeout[label="Do I have timeout?", shape=diamond]
16 top_of_queue_and_can_acquire[
17 label="On top of queue and can acquire lock?",
22 alone->acquire[label="Yes"]
23 alone->add_to_queue[label="No"]
25 have_timeout->abort[label="Yes"]
26 have_timeout->wait[label="No"]
28 top_of_queue_and_can_acquire->acquire[label="Yes"]
29 top_of_queue_and_can_acquire->have_timeout[label="No"]
32 wait->top_of_queue_and_can_acquire
33 acquire->remove_from_queue