diff options
author | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-02 14:28:19 +0000 |
---|---|---|
committer | mmichelson <mmichelson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-02 14:28:19 +0000 |
commit | 26000ee774d06e86e107fa05396b99f3ecd22090 (patch) | |
tree | e31deebaa2748cbd7d2954917d4df203fa682e01 /include | |
parent | 46ef3b9a485256d6d7d35ec9fb0718d306bcdf43 (diff) |
Clarify a comment that was, well, just wrong. It turns out that
ignoring the way that macros expand. Instead, I have clarified in the
comment why the macro will work even if the scheduler id for the
task to be deleted changes during the execution of the macro.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@115196 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/sched.h | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/include/asterisk/sched.h b/include/asterisk/sched.h index 829a1b0f6..d2508bfa8 100644 --- a/include/asterisk/sched.h +++ b/include/asterisk/sched.h @@ -41,17 +41,11 @@ extern "C" { * then whatever callback had been running will complete * and reinsert the task into the scheduler. * - * Note that this is NOT always appropriate. This should - * only be used for tasks whose callback may return non-zero - * to indicate that the task needs to be rescheduled with the - * SAME id as previously. - * - * Some scheduler callbacks instead may reschedule the task themselves, - * thus removing the previous task id from the queue. If the task is rescheduled - * in this manner, then the id for the task will be different than before - * and so it makes no sense to use this macro. Note that if using the scheduler - * in this manner, it is perfectly acceptable for ast_sched_del to fail, and this - * macro should NOT be used. + * Since macro expansion essentially works like pass-by-name + * parameter passing, this macro will still work correctly even + * if the id of the task to delete changes. This holds as long as + * the name of the id which could change is passed to the macro + * and not a copy of the value of the id. */ #define AST_SCHED_DEL(sched, id) \ ({ \ |