aboutsummaryrefslogtreecommitdiffstats
path: root/main/sched.c
AgeCommit message (Collapse)AuthorFilesLines
2010-09-09Merged revisions 285710 via svnmerge from bbryant1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r285710 | bbryant | 2010-09-09 14:50:13 -0400 (Thu, 09 Sep 2010) | 8 lines Fixes an issue with dialplan pattern matching where the specificity for pattern ranges and pattern special characters was inconsistent. (closes issue #16903) Reported by: Nick_Lewis Patches: pbx.c-specificity.patch uploaded by Nick Lewis (license 657) Tested by: Nick_Lewis ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@285711 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-16Finally, a method that really fixes the assertions in chan_iax2.c related to ↵tilghman1-6/+21
cancelling lagid. No, replacing usleep(1) with sched_yield() did not have an effect. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@277484 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-03Initialize counters in ast_sched_report so that resulting data is not bogus.mmichelson1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244547 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-23Fix a regression in scheduler entry ordering, and add a regression test for it.russell1-1/+1
(closes issue #14522) Reported by: pj Tested by: russell git-svn-id: http://svn.digium.com/svn/asterisk/trunk@178022 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-17Significantly improve scheduler performance under high load.russell1-81/+71
This patch changes the scheduler to use a max-heap to store pending scheduler entries instead of a fully sorted doubly linked list. When the number of entries in the scheduler gets large, this will perform much better. For much more detailed information on this change, see the review request. Review: http://reviewboard.digium.com/r/160/ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@176639 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-15Make ast_sched_report() and ast_sched_dump() thread safe.russell1-2/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@175882 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-15Fix a number of problems with ast_sched_report().russell1-22/+15
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: http://svn.digium.com/svn/asterisk/trunk@175829 f38db490-d61c-443f-a65b-d21fe96a405b
2009-02-06Add a common implementation of a scheduler context with a dedicated thread.russell1-1/+143
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: http://svn.digium.com/svn/asterisk/trunk@173858 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-10Merged revisions 142354 via svnmerge from russell1-5/+3
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r142354 | russell | 2008-09-10 11:39:53 -0500 (Wed, 10 Sep 2008) | 7 lines It is a normal situation that a task gets put in the scheduler that should run as soon as possible. Accept "0" as an acceptable time to run, and also treat negative as "run now", and don't print a debug message about it. (inspired by a message asking about the "request to schedule in the past" debug message on the -dev list) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@142355 f38db490-d61c-443f-a65b-d21fe96a405b
2008-08-10That's all, folks. Not going to update the Makefile until res_jabber isseanbright1-11/+11
converted (snuffy, you there? :)) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@137110 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-30Oops, wrong definetilghman1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@134703 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18Merged revisions 131988 via svnmerge from tilghman1-0/+4
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r131988 | tilghman | 2008-07-18 12:10:01 -0500 (Fri, 18 Jul 2008) | 2 lines Oops ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@131989 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18Merged revisions 131985 via svnmerge from tilghman1-0/+4
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: http://svn.digium.com/svn/asterisk/trunk@131986 f38db490-d61c-443f-a65b-d21fe96a405b
2008-07-18Merged revisions 131970 via svnmerge from tilghman1-2/+2
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: http://svn.digium.com/svn/asterisk/trunk@131982 f38db490-d61c-443f-a65b-d21fe96a405b
2008-06-11Merged revisions 121861 via svnmerge from tilghman1-1/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r121861 | tilghman | 2008-06-11 13:18:16 -0500 (Wed, 11 Jun 2008) | 3 lines Make calls to ast_assert() actually test something, so that the error message printed is not nonsensical (reported by mvanbaak via #asterisk-bugs). ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@121867 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-15Use casts or intermediate variables to remove a numberrizzo1-1/+1
of platform/compiler-dependent warnings when handing struct timeval fields, both reading and printing them. It is a lost battle to handle the different ways struct timeval is handled on the various platforms and compilers, so try to be pragmatic and go through int/long which are universally supported. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@116557 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-14Merged revisions 116463 via svnmerge from russell1-3/+1
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r116463 | russell | 2008-05-14 16:32:00 -0500 (Wed, 14 May 2008) | 4 lines Add ast_assert(), which can be used to handle fatal errors. It is only compiled in if dev-mode is enabled, and only aborts if DO_CRASH is defined. (inspired by issue #12650) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@116469 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-07Fix up a problem that was introduced into the scheduler when it was convertedrussell1-4/+15
to use doubly linked lists. The schedule() function had an optimization that had it try to guess which direction would be better for the traversal to insert the task into the scheduler queue. However, if the code chose the path where it traversed the queue in reverse, and the result was that the task should be at the head of the queue, then the code would actually put it at the tail, instead. (Problem found by bbryant, debugged and fixed by bbryant and me) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115537 f38db490-d61c-443f-a65b-d21fe96a405b
2008-05-02Add attributes to various API calls, to help track down bugs (and remove a ↵tilghman1-4/+6
deprecated function) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@115157 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-16Introducing a small upgrade to the ast_sched_xxx facility, to keep it from ↵murf1-37/+149
eating up lots of cpu cycles. See CHANGES. From the team/murf/bug11210 branch. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@114182 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21remove a bunch of useless #include "options.h"rizzo1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89511 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)rizzo1-1/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89425 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Start untangling header inclusion in a way that does not affectrizzo1-4/+0
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08improve linked-list macros in two ways:kpfleming1-4/+4
- the *_CURRENT macros no longer need the list head pointer argument - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89106 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-21Merged revisions 83432 via svnmerge from russell1-5/+5
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: http://svn.digium.com/svn/asterisk/trunk@83433 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-30A schedule id of 0 is not possible and is used to flag that we want to add a ↵tilghman1-1/+2
new item git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81390 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-17This commit adds a scheduler API call, ast_sched_replace that can be usedrussell1-0/+13
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: http://svn.digium.com/svn/asterisk/trunk@79861 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-25Convert so more logging to ast_debug (issue #10045, dimas)russell1-16/+14
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@71557 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-24Conversions to ast_debug()russell1-13/+9
(issue #9984, patches from eliel and dimas) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@71338 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06Issue 9869 - replace malloc and memset with ast_calloc, and other coding ↵tilghman1-4/+4
guidelines changes git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-23Merged revisions 56457 via svnmerge from file1-1/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r56457 | file | 2007-02-23 16:53:41 -0500 (Fri, 23 Feb 2007) | 2 lines Change log notice to debug. It is possible for a scheduled item to execute and be deleted at close to the same time and unavoidable. If this happens this message creeps up. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@56458 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-03bug #8076 check option_debug before printing to debug channel.mogorman1-14/+18
patch provided in bugnote, with minor changes. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@44253 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-0/+399
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b