mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 23:34:08 +00:00
libobs: Add comment warning about scene mutex lock ordering
A comment that serves as a reminder to anyone who might need to edit the scene code. If the graphics mutex must be locked, it must be locked first before entering the scene mutexes, or outside of the scene mutexes.
This commit is contained in:
parent
ce0a189228
commit
91ebb5c5e0
|
@ -20,6 +20,17 @@
|
|||
#include "graphics/math-defs.h"
|
||||
#include "obs-scene.h"
|
||||
|
||||
/* NOTE: For proper mutex lock order (preventing mutual cross-locks), never
|
||||
* lock the graphics mutex inside either of the scene mutexes.
|
||||
*
|
||||
* Another thing that must be done to prevent that cross-lock (and improve
|
||||
* performance), is to not create/release/update sources within the scene
|
||||
* mutexes.
|
||||
*
|
||||
* It's okay to lock the graphics mutex before locking either of the scene
|
||||
* mutexes, but not after.
|
||||
*/
|
||||
|
||||
static const char *obs_scene_signals[] = {
|
||||
"void item_add(ptr scene, ptr item)",
|
||||
"void item_remove(ptr scene, ptr item)",
|
||||
|
|
Loading…
Reference in a new issue