validate: Protect init function with a recursive mutex
authorThibault Saunier <tsaunier@igalia.com>
Wed, 1 Mar 2023 03:56:51 +0000 (00:56 -0300)
committerTim-Philipp Müller <tim@centricular.com>
Thu, 2 Mar 2023 10:57:45 +0000 (10:57 +0000)
commite66d636fd1e7b2a9fbebb5c05767215666f66d00
treea5eecf92b44cd5568059f19659a6525cc0353ad4
parent85d363f4e2312bbfd7b807910a54ceb1046063e8
validate: Protect init function with a recursive mutex

In tests in the rust bindings we end up with 2 thread initializing
concurrently, and it should not be a problem, -validate should be MT
safe.

Using a recursive mutex as we might recursively init for some reason
and we are not on the hot path here in any case.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4097>
subprojects/gst-devtools/validate/gst/validate/validate.c