1、避免嵌套锁:假如已经持有锁,就不要尝试获取第二个锁
3、依从固定顺序获取锁
4、按照层级加锁
具体做法:赋予层级的编号,记录各线程分别锁定了哪些mutex。
No comments yet.
Sign in to comment and like
No comments yet.