diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-11-06 13:42:49 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-11-06 13:42:49 +0000 |
commit | 13712e46ce30b5ad84a30994d03fedfbab2a3820 (patch) | |
tree | 6dcb70dd4e2f0252df93897ac2bbe9f5d7aa9296 /nuttx/sched/work_queue.c | |
parent | 3cd0ce8e626ad57b2695899278c62c057bab05ef (diff) | |
download | px4-nuttx-13712e46ce30b5ad84a30994d03fedfbab2a3820.tar.gz px4-nuttx-13712e46ce30b5ad84a30994d03fedfbab2a3820.tar.bz2 px4-nuttx-13712e46ce30b5ad84a30994d03fedfbab2a3820.zip |
Fix a potential race condition
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2234 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/work_queue.c')
-rwxr-xr-x | nuttx/sched/work_queue.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/nuttx/sched/work_queue.c b/nuttx/sched/work_queue.c index 46afdc1d8..144c32178 100755 --- a/nuttx/sched/work_queue.c +++ b/nuttx/sched/work_queue.c @@ -83,6 +83,13 @@ * Queue work to be performed at a later time. All queued work will be * performed on the worker thread of of execution (not the caller's). * + * The work structure is allocated by caller, but completely managed by + * the work queue logic. The caller should never modify the contents of + * the work queue structure; the caller should not call work_queue() + * again until either (1) the previous work has been performed and removed + * from the queue, or (2) work_cancel() has been called to cancel the work + * and remove it from the work queue. + * * Input parameters: * work - The work structure to queue * worker - The worker callback to be invoked. The callback will invoked |