diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-09-02 13:37:28 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2012-09-02 13:37:28 +0000 |
commit | 1349b00b418de388310c6658fd799a9049ddd38b (patch) | |
tree | fe120379f9e5870a741b4ec5a7f88e3f70c2df3b /nuttx/sched | |
parent | 7b149edcfcb1c3183804ac7c385f9876b121fe4f (diff) | |
download | px4-firmware-1349b00b418de388310c6658fd799a9049ddd38b.tar.gz px4-firmware-1349b00b418de388310c6658fd799a9049ddd38b.tar.bz2 px4-firmware-1349b00b418de388310c6658fd799a9049ddd38b.zip |
Fix workqueue assertion; STM32 power management
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5079 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/sched')
-rw-r--r-- | nuttx/sched/work_cancel.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/nuttx/sched/work_cancel.c b/nuttx/sched/work_cancel.c index c277f024d..30b650826 100644 --- a/nuttx/sched/work_cancel.c +++ b/nuttx/sched/work_cancel.c @@ -104,10 +104,16 @@ int work_cancel(struct work_s *work) flags = irqsave(); if (work->worker != NULL) { - DEBUGASSERT(work->dq.flink || (FAR dq_entry_t *)work == g_work.head); - DEBUGASSERT(work->dq.blink || (FAR dq_entry_t *)work == g_work.tail); - dq_rem((FAR dq_entry_t *)work, &g_work); + /* A little test of the integrity of the work queue */ + + DEBUGASSERT(work->dq.flink ||(FAR dq_entry_t *)work == g_work.tail); + DEBUGASSERT(work->dq.blink ||(FAR dq_entry_t *)work == g_work.head); + /* Remove the entry from the work queue and make sure that it is + * mark as availalbe (i.e., the worker field is nullified). + */ + + dq_rem((FAR dq_entry_t *)work, &g_work); work->worker = NULL; } |