Shared Tasks Lock Order CSV is one of Understand's built-in reports — run it on your own code from the GUI, or headlessly with und report.
Shared Tasks Lock Order CSV
| Targets | Architectures |
| Languages | Any |
| Solution | Shared Tasks |
| Tags | Concurrency |
Table of the lock orders that tasks use, with possible deadlocks.
This report lists what the lock order graph shows, one row for each call site that takes a lock while the task may still hold another. It uses the same architecture as the graph.
The columns are:
- Held Lock and Acquired Lock: the task takes the acquired lock while it may still hold the held lock. Locks with the same name also show their file, function or lock and unlock pair, whichever differ.
- Possible Deadlock: x when this order is part of a possible deadlock.
- Order to Reverse: x when this order is the suggested fix for its deadlock.
- Cycle: the numbers of the possible deadlocks this order is part of, so rows of the same deadlock can be grouped. Deadlocks between fewer locks are numbered first.
- Task, Function, File and Line: the task, and where the acquired lock is taken.
When locks or deadlocks may be missing, a second table lists the reasons. It isn't made when everything was checked. Export both tables to CSV from the command line with:
und report -format csv -arch "ARCH" "Shared Tasks Lock Order CSV" OUT_DIRECTORY
The lock orders are written to table0.csv, and the
reasons, when there are any, to table1.csv.
See the lock order graph for how to set up the architecture. Also related are concurrency plugins.