Skip to content

util: Detect use-after-destroy in simple_mtx

Kenneth Graunke requested to merge kwg/mesa:mtx-invalid into master

This makes simple_mtx_destroy set the counter to an invalid canary value and then makes lock/unlock assert that the value is legal.

That way, calling lock/unlock after destroy will assert fail, rather than deadlocking or potentially even working.

This has caught real deadlocks in dEQP multithreaded tests (in st/mesa shader variant zombie list handling), which have since been fixed.

Merge request reports