Revision 8fa74099 doc/design-2.1.rst
b/doc/design-2.1.rst | ||
---|---|---|
229 | 229 |
acquires and no current holders. The caller can have the lock |
230 | 230 |
immediately. |
231 | 231 |
|
232 |
.. graphviz:: design-2.1-lock-acquire.dot
|
|
232 |
.. digraph:: "design-2.1-lock-acquire"
|
|
233 | 233 |
|
234 |
graph[fontsize=8, fontname="Helvetica"] |
|
235 |
node[fontsize=8, fontname="Helvetica", width="0", height="0"] |
|
236 |
edge[fontsize=8, fontname="Helvetica"] |
|
237 |
|
|
238 |
/* Actions */ |
|
239 |
abort[label="Abort\n(couldn't acquire)"] |
|
240 |
acquire[label="Acquire lock"] |
|
241 |
add_to_queue[label="Add condition to queue"] |
|
242 |
wait[label="Wait for notification"] |
|
243 |
remove_from_queue[label="Remove from queue"] |
|
244 |
|
|
245 |
/* Conditions */ |
|
246 |
alone[label="Empty queue\nand can acquire?", shape=diamond] |
|
247 |
have_timeout[label="Do I have\ntimeout?", shape=diamond] |
|
248 |
top_of_queue_and_can_acquire[ |
|
249 |
label="On top of queue and\ncan acquire lock?", |
|
250 |
shape=diamond, |
|
251 |
] |
|
252 |
|
|
253 |
/* Lines */ |
|
254 |
alone->acquire[label="Yes"] |
|
255 |
alone->add_to_queue[label="No"] |
|
256 |
|
|
257 |
have_timeout->abort[label="Yes"] |
|
258 |
have_timeout->wait[label="No"] |
|
259 |
|
|
260 |
top_of_queue_and_can_acquire->acquire[label="Yes"] |
|
261 |
top_of_queue_and_can_acquire->have_timeout[label="No"] |
|
262 |
|
|
263 |
add_to_queue->wait |
|
264 |
wait->top_of_queue_and_can_acquire |
|
265 |
acquire->remove_from_queue |
|
234 | 266 |
|
235 | 267 |
Release |
236 | 268 |
******* |
... | ... | |
244 | 276 |
exclusive locks by forcing consecutive shared acquires to wait in the |
245 | 277 |
queue. |
246 | 278 |
|
247 |
.. graphviz:: design-2.1-lock-release.dot |
|
279 |
.. digraph:: "design-2.1-lock-release" |
|
280 |
|
|
281 |
graph[fontsize=8, fontname="Helvetica"] |
|
282 |
node[fontsize=8, fontname="Helvetica", width="0", height="0"] |
|
283 |
edge[fontsize=8, fontname="Helvetica"] |
|
284 |
|
|
285 |
/* Actions */ |
|
286 |
remove_from_owners[label="Remove from owner list"] |
|
287 |
notify[label="Notify topmost"] |
|
288 |
swap_shared[label="Swap shared conditions"] |
|
289 |
success[label="Success"] |
|
290 |
|
|
291 |
/* Conditions */ |
|
292 |
have_pending[label="Any pending\nacquires?", shape=diamond] |
|
293 |
was_active_queue[ |
|
294 |
label="Was active condition\nfor shared acquires?", |
|
295 |
shape=diamond, |
|
296 |
] |
|
297 |
|
|
298 |
/* Lines */ |
|
299 |
remove_from_owners->have_pending |
|
300 |
|
|
301 |
have_pending->notify[label="Yes"] |
|
302 |
have_pending->success[label="No"] |
|
303 |
|
|
304 |
notify->was_active_queue |
|
305 |
|
|
306 |
was_active_queue->swap_shared[label="Yes"] |
|
307 |
was_active_queue->success[label="No"] |
|
308 |
|
|
309 |
swap_shared->success |
|
248 | 310 |
|
249 | 311 |
|
250 | 312 |
Delete |
Also available in: Unified diff