ek9_query_lock_analysis
Answers first: status, then deadlockCount, lockIdentityCount, enterSiteCount, keyBodyCount, crossThreadEdgeCount and nextStep (the one drill-down worth calling); lockIdentityCount 0 = no MutexLock anywhere, deadlock structurally impossible.
When to use it
'Does this workspace have any lock or deadlock risk at all' is one call with no arguments - the headline counts before any lock drill-down.
When not to use it
- the rationale chains behind a deadlock risk, deadlockCount > 0 (use
ek9_query_deadlock_chain) - the catalogue of distinct locks (origin, display name), not just the count (use
ek9_query_lock_identity) - the inventory of enter()/tryEnter() acquisition sites (use
ek9_query_enter_sites) - the raw E08252/E08253 as compiler diagnostics rather than the summary (use
ek9_query_diagnostics)
Details
Zero parameters; whole-workspace only, no module scoping. status is 'ok' (analysis ran, counts live) or 'not-compiled' (no compiled program, or compilation failed before PRE_IR_CHECKS produced a LockAnalysis — nextStep ek9_compile). nextStep on 'ok': deadlockCount>0 -> ek9_query_deadlock_chain, lockIdentityCount>0 -> ek9_query_lock_identity, otherwise none — lockIdentityCount==0 means no MutexLock use anywhere, so structural deadlock is impossible.
Arguments
None of its own.
Recorded calls
Real calls, recorded against small projects and checked on every build - a changed answer fails it.
No compiled program
Request
{ }
Response
{
"meta" : {
"serverMs" : "<timing>"
},
"nextStep" : "ek9_compile",
"note" : "No compiled program is available - nothing can be queried until the workspace compiles.",
"status" : "not-compiled"
}
Populated workspace
Request
{ }
Response
{
"crossThreadEdgeCount" : 0,
"deadlockCount" : 0,
"enterSiteCount" : 1,
"functionSummaryCount" : 3,
"keyBodyCount" : 1,
"lockIdentityCount" : 1,
"meta" : {
"serverMs" : "<timing>"
},
"nextStep" : "ek9_query_lock_identity",
"status" : "ok"
}
No locks workspace
Request
{ }
Response
{
"crossThreadEdgeCount" : 0,
"deadlockCount" : 0,
"enterSiteCount" : 0,
"functionSummaryCount" : 2,
"keyBodyCount" : 0,
"lockIdentityCount" : 0,
"meta" : {
"serverMs" : "<timing>"
},
"nextStep" : "none - no MutexLock use anywhere, structural deadlock is impossible",
"status" : "ok"
}