196 Star 1.1K Fork 421

OpenHarmony / kernel_liteos_a

增强OsLockDepCheckOut()鲁棒性

缺陷
待办的
laokz  Opened this issue
  1. https://openharmony.gitee.com/openharmony/kernel_liteos_a/blob/6df931fc981500cf629a3dfb5e0a01f375d0fa05/kernel/base/mp/los_lockdep.c#L265,函数OsLockDepCheckOut检查了试图释放空闲锁的情况,建议增加释放别人锁的检查,以使函数更健壮。如将该行修改为:
    if (owner != current) {

不影响原来的功能,也能适应对新增错误的处理。

  1. 同样在这个函数第285行:
    heldlocks[depth].holdTime = OsLockDepGetCycles() - heldlocks[depth].holdTime;

冗余:一是这部分信息可能被后面语句覆盖,二是没人收集holdtime信息。建议删除。

Attachments
total 1 participants

Comments (0)

Sign in to comment

Assignees
Labels
Not set
Projects
Milestones
Branches
Planed to start
Not set
Planed to end
Not set
Top level
Priority
C
1
https://git.oschina.net/openharmony/kernel_liteos_a.git
git@git.oschina.net:openharmony/kernel_liteos_a.git
openharmony
kernel_liteos_a
kernel_liteos_a

Search