summaryrefslogtreecommitdiffstats
path: root/src/timer.c
Commit message (Collapse)AuthorAgeFilesLines
* add osmo_gettimeofday as a shim around gettimeofdayNeels Hofmeyr2016-09-221-4/+4
| | | | | | | This allows feeding a custom time for unit tests by overriding osmo_gettimeofday. Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
* Update doxygen annotations in libosmocoreHarald Welte2016-05-051-0/+2
| | | | | This adds and improves doxygen API descriptions all over libosmocore, reducing the 'white spots' that don't have any documentation.
* timer: Fix compiler warning about timevalHolger Hans Peter Freyther2015-08-211-3/+4
| | | | | | | | | timer.c:27:23: warning: tentative definition of variable with internal linkage has incomplete non-array type 'struct timeval' [-Wtentative-definition-incomplete-type] static struct timeval nearest; ^ timer.c:27:15: note: forward declaration of 'struct timeval' static struct timeval nearest;
* timer: Use the now parameter when it is not NULLHolger Hans Peter Freyther2014-05-231-3/+3
| | | | | | | | The code would have used an uninitialized current_time in case "now" was not NULL. As now is const and timersub expects a non const parameter I decided to copy now into current_time. Fixes: CID #1040661
* misc: Doxygen tweaks: fixed some typos and minor errorsKaterina Barone-Adesi2013-02-151-1/+1
| | | | | Doxygen generates quite a lot of warnings on libosmocore. Some of them are obvious typos - this patch aims to fix such low-hanging fruit.
* add some missing doxygen annotation for libosmocore functionsHarald Welte2013-01-111-7/+5
|
* timer: Add function osmo_timer_remaining() to determine remainign timeHarald Welte2012-07-131-0/+28
|
* doc: Fix the Doxygen section endingsSylvain Munaut2012-04-181-1/+1
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* timer: Better fix to the timer re-scheduling situationPablo Neira Ayuso2011-11-131-6/+3
| | | | | | | | | As it turns out, the previous fix didn't cover the case of a timer X being re-scheduled inside a timer call back expiring at the same time as the previous X instance. Written-by: Pablo Neira Ayuso <pablo@gnumonks.org> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* core/timer: Allow an already scheduled timer to be re-scheduled at a new timeSylvain Munaut2011-11-121-2/+6
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* timer: Add compatibility header with timer helpersSylvain Munaut2011-10-211-0/+1
| | | | | | Some of these are not always present, especially when cross compiling Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* timer: Simplify osmo_timers_nearest even moreSylvain Munaut2011-10-181-4/+4
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* timer: Fix implementation of osmo_timers_nearest causing high CPU loadSylvain Munaut2011-10-171-4/+2
| | | | Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
* timer: add scalable RB-tree based timer infrastructurePablo Neira Ayuso2011-10-171-81/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds RB-tree based timers which scales better than the previous list-based implementation. It does not require any API changes. It breaks ABI because the osmo_timer_list structure has changed though (to avoid this in the future, we can put internal data in some private structure). The following table summarizes the worst-case computational complexity of this new implementation versus the previous one: rb-tree list-based ------- ---------- calculate next timer to expire O(1) O(n) insertion of new timer O(log n) O(n) deletion of timer O(log n) O(1) timer-fired scheduler O(log n) O(3n) The most repeated cases are: * the calculation of the next timer to expire, that happens in every loop of our select function. * the timer-fired scheduler execution. This new implementation only loses in the deletion of timer scenario, this happens because we may need to rebalance the tree after the removal. So I think there is some real gain if we have some situation in which we have to handle lots of timers.
* some more doxygen work (include the notion of modules)Harald Welte2011-08-171-0/+36
|
* timer: use (void) for functions that take no argumentsHarald Welte2011-07-161-3/+3
| | | | This has been detected by http://smatch.sourceforge.net/
* timer: use namespace prefix osmo_timer*Pablo Neira Ayuso2011-05-071-14/+15
| | | | | | | | | | | | | | Summary of changes: s/struct timer_list/struct osmo_timer_list/g s/bsc_add_timer/osmo_timer_add/g s/bsc_schedule_timer/osmo_timer_schedule/g s/bsc_del_timer/osmo_timer_del/g s/bsc_timer_pending/osmo_timer_pending/g s/bsc_nearest_timer/osmo_timers_nearest/g s/bsc_prepare_timers/osmo_timers_prepare/g s/bsc_update_timers/osmo_timers_update/g s/bsc_timer_check/osmo_timers_check/g
* include: reorganize headers file to include/osmocom/[gsm|core]Pablo Neira Ayuso2011-03-231-1/+1
| | | | | | | | | | | | This patch moves all GSM-specific definitions to include/osmocom/gsm. Moreover, the headers in include/osmocore/ have been moved to include/osmocom/core. This has been proposed by Harald Welte and Sylvain Munaunt. Tested with `make distcheck'. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
* intial checkin of the libosmocore projectHarald Welte2010-02-201-0/+185