mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 01:05:54 +08:00
sched/notifier: fix invaild unique key
N/A Change-Id: Ie63af2a24a0421239d40b580b841cbf5abae446f Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -135,9 +135,14 @@ static FAR struct work_notifier_entry_s *work_notifier_find(uint32_t key)
|
||||
|
||||
static uint32_t work_notifier_key(void)
|
||||
{
|
||||
static uint32_t g_notifier_key;
|
||||
static uint32_t notifier_key;
|
||||
|
||||
return g_notifier_key++;
|
||||
if (++notifier_key == 0)
|
||||
{
|
||||
++notifier_key;
|
||||
}
|
||||
|
||||
return notifier_key;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -283,8 +288,6 @@ int work_notifier_teardown(int key)
|
||||
irqstate_t flags;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(key > 0 && key <= INT16_MAX);
|
||||
|
||||
/* Disable interrupts very briefly. */
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
Reference in New Issue
Block a user