summaryrefslogtreecommitdiff
path: root/include/asterisk/sched.h
AgeCommit message (Collapse)Author
2017-12-22Remove as much trailing whitespace as possible.Sean Bright
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2015-02-19Create work around for scheduler leaks during shutdown.Corey Farrell
* Added ast_sched_clean_by_callback for cleanup of scheduled events that have not yet fired. * Run all pending peercnt_remove_cb and replace_callno events in chan_iax2. Cleanup of replace_callno events is only run 11, since it no longer releases any references or allocations in 13+. ASTERISK-24451 #close Reported by: Corey Farrell Review: https://reviewboard.asterisk.org/r/4425/ ........ Merged revisions 431916 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 431917 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@431918 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2014-08-28sched: Fix typo and whitespace change.Richard Mudgett
........ Merged revisions 422200 from http://svn.asterisk.org/svn/asterisk/branches/13 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@422201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20ast_channel opaquification of pointers and integral typesTerry Wilson
Review: https://reviewboard.asterisk.org/r/1753/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04Replace ast_log(LOG_DEBUG, ...) with ast_debug()Paul Belanger
(closes issue #18556) Reported by: kkm Review: https://reviewboard.asterisk.org/r/1071/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20Some scheduler API cleanup and improvements.Russell Bryant
Previously, I had added the ast_sched_thread stuff that was a generic scheduler thread implementation. However, if you used it, it required using different functions for modifying scheduler contents. This patch reworks how this is done and just allows you to optionally start a thread on the original scheduler context structure that has always been there. This makes it trivial to switch to the generic scheduler thread implementation without having to touch any of the other code that adds or removes scheduler entries. In passing, I made some naming tweaks to add ast_ prefixes where they were not there before. Review: https://reviewboard.asterisk.org/r/1007/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-14Merged revisions 282366 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r282366 | tilghman | 2010-08-13 23:53:58 -0500 (Fri, 13 Aug 2010) | 4 lines Fix our FRACKing issue with chan_iax2 a different way. Review: https://reviewboard.asterisk.org/r/861/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@282367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16Finally, a method that really fixes the assertions in chan_iax2.c related to ↵Tilghman Lesher
cancelling lagid. No, replacing usleep(1) with sched_yield() did not have an effect. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-28Fix some incorrect documentation of sched_thread functions.Mark Michelson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@214650 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-09Add Doxygen documentation for API changes from 1.6.0 to 1.6.1Jeff Peeler
Copied from my review board description: This is a continuation of the API changes documentation started for describing changes between releases. Most of the API changes were pretty simple needing only to be brought to attention via the new "Asterisk API Changes" list. However, if you see anything that needs further explanation feel free to supplement what is there. The current method of documenting is to add (in the header file): \version <ver number> <description of changes> and then to add the function to the change list in doxyref.h on the AstAPIChanges page. I also made sure all the functions that were newly added were tagged with \since 1.6.1. I think this is a good habit to start both for the historical aspect as well as for the future ability to easily add a "New Asterisk API" page. Review: http://reviewboard.digium.com/r/190/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-15Make ast_sched_report() and ast_sched_dump() thread safe.Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-15Fix a number of problems with ast_sched_report().Russell Bryant
1) It had numerous coding guidelines violations with regards to formatting. 2) It allocated memory using ast_calloc() that was never freed. 3) It didn't check for failure from the allocation. 4) It used sprintf() and strcat() to build the result, doing zero checking to prevent writing past the end of the provided buffer. The function also lacks API documentation, but that has not been addressed in this commit. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06Add a common implementation of a scheduler context with a dedicated thread.Russell Bryant
This commit expands the Asterisk scheduler API to include a common implementation of a scheduler context being processed by a dedicated thread. chan_iax2 has been updated to use this new code. Also, as a result, this resolves some race conditions related to the previous chan_iax2 scheduler handling. Related to rev 171452 which resolved the same issues in 1.4. Code from team/russell/sched_thread2 Review: http://reviewboard.digium.com/r/129/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30Fix a bug in AST_SCHED_REPLACE_UNREF(). The reference count of the objectRussell Bryant
_must_ be increased before creating the scheduler entry. Otherwise, you create a race condition where the reference count may hit zero and the object can disappear out from under you. This could also would have incorrectly decreased the reference count in the case that the scheduler add failed. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@152887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-17Fix the FRACK! warnings in chan_iax2 when POKE/LAGRQ packets are not answered.Tilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@150580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-30Oops, wrong defineTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134703 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18Merged revisions 131985 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r131985 | tilghman | 2008-07-18 11:46:23 -0500 (Fri, 18 Jul 2008) | 2 lines Preserve ABI compatibility with last change ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-18Merged revisions 131970 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r131970 | tilghman | 2008-07-18 11:30:31 -0500 (Fri, 18 Jul 2008) | 2 lines Make the ast_assert call within ast_sched_del report something useful. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@131982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-06-19Detect if the installed gcc version supports the warn_unused_result attribute.Tilghman Lesher
Reported by mvanbaak via IRC -dev. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@123988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02Merged revisions 115196 via svnmerge from Mark Michelson
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. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-05-02Add attributes to various API calls, to help track down bugs (and remove a ↵Tilghman Lesher
deprecated function) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115157 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-04-16Introducing a small upgrade to the ast_sched_xxx facility, to keep it from ↵Steve Murphy
eating up lots of cpu cycles. See CHANGES. From the team/murf/bug11210 branch. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@114182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-12Merged revisions 108227 via svnmerge from Mark Michelson
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r108227 | mmichelson | 2008-03-12 16:16:28 -0500 (Wed, 12 Mar 2008) | 12 lines Added a large comment before the AST_SCHED_DEL macro to explain its purpose as well as when it is appropriate and when it is not appropriate to use it. I also removed the part of the debug message that mentions that this is probably a bug because there are some perfectly legitimate places where ast_sched_del may fail to delete an entry (e.g. when the scheduler callback manually reschedules with a new id instead of returning non-zero to tell the scheduler to reschedule with the same idea). I also raised the debug level of the debug message in AST_SCHED_DEL since it seems like it could come up quite frequently since the macro is probably being used in several places where it shouldn't be. Also removed the redundant line, file, and function information since that is provided by ast_log. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@108238 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-07Merged revisions 106704 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106704 | russell | 2008-03-07 11:16:58 -0600 (Fri, 07 Mar 2008) | 8 lines Change a warning message to a debug message. This is happening quite frequently, and it is not worth spamming users with these messages unless we are pretty confident that it should never happen. As it stands today, it _will_ and _does_ happen and until that gets cleaned up a reasonable amount on the development side, let's not spam the logs of everyone else. (closes issue #12154) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-05Merged revisions 106015 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r106015 | tilghman | 2008-03-05 09:17:16 -0600 (Wed, 05 Mar 2008) | 7 lines Correctly initialize retransid in SIP, and ensure that the warning when failing to delete a schedule entry can actually hit the log. (closes issue #12140) Reported by: slavon Patches: sch2.patch uploaded by slavon (license 288) (Patch slightly modified by me) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@106036 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-20Add some documentation fixupsTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-27With the switch to the ast_sched_replace* API in trunk, we lose the correctionTilghman Lesher
that was just merged from 1.4, so this is a changeover to those APIs to use the macro versions, so that we properly detect errors from ast_sched_del, instead of simply ignoring the return values. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-27Merged revisions 100465 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r100465 | tilghman | 2008-01-27 15:59:53 -0600 (Sun, 27 Jan 2008) | 11 lines When deleting a task from the scheduler, ignoring the return value could possibly cause memory to be accessed after it is freed, which causes all sorts of random memory corruption. Instead, if a deletion fails, wait a bit and try again (noting that another thread could change our taskid value). (closes issue #11386) Reported by: flujan Patches: 20080124__bug11386.diff.txt uploaded by Corydon76 (license 14) Tested by: Corydon76, flujan, stuarth` ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@100488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21Merged revisions 83432 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83432 | russell | 2007-09-21 09:37:20 -0500 (Fri, 21 Sep 2007) | 4 lines gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set of changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2. (closes issue #10774, patch from qwell) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17This commit adds a scheduler API call, ast_sched_replace that can be usedRussell Bryant
in place of a very common construct. I also used it in a number of places in chan_sip. if (id > -1) ast_sched_del(sched, id); id = ast_sched_add(sched, ...); changes to: ast_sched_replace(id, sched, ...); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-31removal of trailing whitespace and useless 'extern'Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@16653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-24 Doxygen typo fix.BJ Weschke
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@14612 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-03-10Doxygen reformattingOlle Johansson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@12491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-11-29remove extraneous svn:executable propertiesKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7221 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-10-24Doxygen documentation update from oej (issue #5505)Russell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-08-30major header file cleanup: license, copyrights, descriptions, markers, etc.Kevin P. Fleming
remove deprecated config_old.c/config_old.h remove unused cvsid.h git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-08-22add preliminary support for SIP timers (issue #4359)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-07-15add a library of timeval manipulation functions, and change a large number ↵Kevin P. Fleming
of usses to use the new functions (bug #4504) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-05-03correct documentation for ast_sched_add (bug #4136)Kevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5556 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-04-13Add sched_when function (bug #4022)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-03-05Remove accidental libpri dependency (bug #3714)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2005-01-15Repair // comments to /* */ comments (bug #3347)Mark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2001-11-06Version 0.1.10 from FTPMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1999-12-11Version 0.1.1 from FTPMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1999-10-27Version 0.1.0 from FTPMark Spencer
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@10 65c4cc65-6c06-0410-ace0-fbb531ad65f3