Is it safe to use std::mutex::try_lock or ScopedTryLock on the realtime thread?

(Sorry it is a 3 years old thread, but i have exactly the same question.)

In the Timur Doumler’s blog it is said that it is NOT safe due to mutex_unlock. But i read a paper about that approach few time ago that doesn’t refer to this problem (sorry in french) < https://hal.archives-ouvertes.fr/hal-01791422/document >.

I would like to get POV about that:

  1. Is it a theoretical case, or did people really experienced such blocking while unlocking the mutex?
  2. When replacing the mutex by a spin lock, what’s happen if the DSP thread is preempted with the lock aquired (especially with ONE core)?