[asterisk-commits] mmichelson: branch 1.6.0 r115198 - in /branches/1.6.0: ./ include/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 2 09:29:49 CDT 2008


Author: mmichelson
Date: Fri May  2 09:29:49 2008
New Revision: 115198

URL: http://svn.digium.com/view/asterisk?view=rev&rev=115198
Log:
Merged revisions 115197 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r115197 | mmichelson | 2008-05-02 09:28:55 -0500 (Fri, 02 May 2008) | 14 lines

Merged revisions 115196 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r115196 | mmichelson | 2008-05-02 09:28:19 -0500 (Fri, 02 May 2008) | 6 lines

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.


........

................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/include/asterisk/sched.h

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/include/asterisk/sched.h
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/include/asterisk/sched.h?view=diff&rev=115198&r1=115197&r2=115198
==============================================================================
--- branches/1.6.0/include/asterisk/sched.h (original)
+++ branches/1.6.0/include/asterisk/sched.h Fri May  2 09:29:49 2008
@@ -41,17 +41,11 @@
  * 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) \
 	do { \




More information about the asterisk-commits mailing list