提交 91ebb5c5 编写于 作者: J jp9000

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.
上级 ce0a1892
......@@ -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)",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册