aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/timer.h
AgeCommit message (Collapse)AuthorFilesLines
2017-09-25Add time conversion helpersMax1-0/+5
Add macros to break down absolute time in seconds into days/hours/minutes passed. Change-Id: I46b9a405c18ed9da8f31b7d5b6dcece5468bafbf
2017-06-23doxygen: unify use of \file across the boardNeels Hofmeyr1-5/+3
Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
2017-06-23doxygen: various fixes in core/timer.hNeels Hofmeyr1-19/+16
Move a longish comment to the timer group so that it appears in the API doc. Un-doxygen some floating comments that were associated with unrelated code items ('/**' --> '/*'). Add braces to some function names so that the API doc will render as reference links. Change-Id: I3ea5b88cbe9cb54702429158bf47e768e04e8fe7
2017-06-23doxygen: enable AUTOBRIEF, drop \briefNeels Hofmeyr1-8/+8
Especially for short descriptions, it is annoying to have to type \brief for every single API doc. Drop all \brief and enable the AUTOBRIEF feature of doxygen, which always takes the first sentence of an API doc as the brief description. Change-Id: I11a8a821b065a128108641a2a63fb5a2b1916e87
2017-05-09timer: add osmo_timer_setup()Pablo Neira Ayuso1-0/+2
Add a new function timer function to set up the timer, similar to what we have in the Linux kernel. This patch also converts existing opencoded timer setup in the libosmocore tree as initial client of this new function. This patch implicitly removes function callback passed by reference that defeat compile time type validation. Compile-tested only, but I ran make check that reports success when testing timer infrastructure. Change-Id: I2fa49972ecaab3748b25168b26d92034e9145666
2016-09-22add osmo_gettimeofday as a shim around gettimeofdayNeels Hofmeyr1-0/+11
This allows feeding a custom time for unit tests by overriding osmo_gettimeofday. Change-Id: Ic7a81a6eb51f27fe452962b91f2eae2070d87089
2015-11-02fix some typosNeels Hofmeyr1-4/+4
Sponsored-by: On-Waves ehi
2014-06-16include: Switch to #pragma once patternSylvain Munaut1-4/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-07-13timer: Add function osmo_timer_remaining() to determine remainign timeHarald Welte1-1/+3
2012-04-18doc: Fix the Doxygen section endingsSylvain Munaut1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-10-17timer: add scalable RB-tree based timer infrastructurePablo Neira Ayuso1-3/+3
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.
2011-08-17some more doxygen work (include the notion of modules)Harald Welte1-26/+6
2011-08-16start to add doxygen documentation to libosmocore headersHarald Welte1-8/+43
2011-07-16timer: use (void) for functions that take no argumentsHarald Welte1-3/+3
This has been detected by http://smatch.sourceforge.net/
2011-05-07timer: use namespace prefix osmo_timer*Pablo Neira Ayuso1-10/+10
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
2011-03-23include: reorganize headers file to include/osmocom/[gsm|core]0.2.0Pablo Neira Ayuso1-0/+72
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>