Closed chenBright closed 1 month ago
Issue Number:
Problem Summary:
Changed:
加锁成功记录下拥有锁的bthread/pthread id,如果在同一个bthread/pthread,就可以检测到在同一个bthread/pthread中重复加锁。
Side effects:
Performance effects(性能影响):
Breaking backward compatibility(向后兼容性):
这个是否会影响性能?
之前的实现不会影响性能,但是没用原子变量没法保证正确性。现在用原子变量实现后会导致性能退化,MutexTest.performance测试发现锁的平均运行时间慢了50%左右,所以该功能只作为debug手段,默认关闭,只有编译bRPC库时定义了DEBUG_MUTEX宏才会开启该功能。
LGTM
@chenBright 这个PR和主干冲突了
What problem does this PR solve?
Issue Number:
Problem Summary:
What is changed and the side effects?
Changed:
加锁成功记录下拥有锁的bthread/pthread id,如果在同一个bthread/pthread,就可以检测到在同一个bthread/pthread中重复加锁。
Side effects:
Performance effects(性能影响):
Breaking backward compatibility(向后兼容性):
Check List: