Just in case some user still needs the object
to be used through the code later.
E.g.: DBRegAgent module.
Change-Id: Iacd9104edfe757cf475ab25192411103124ed98b
Move determination of absolute expiry time up into insert_timer(), and
make the rest of the code operate on absolute time. Add an extra method
to directly support absolute time.
Change-Id: I0a8dd27d82fb69b5083a6cfab693bfb275738495
Don't store the relative expiry duration in the timer object. Only store
the absolute value. Pass the relative expiry for a new timer as a method
argument when inserting the timer into the tree instead.
No functional/behavioural changes.
Change-Id: I24817b0ac5801a5addf05bf9155fcb31017f2f68
Move some of the timer arming logic out of the wheeltimer and into the
timer class, so that more members can be made private. No functional
changes.
Change-Id: I4f2a10b0a3d9c775ec6cb903c2b82f4aa3219349
There is no reason we cannot directly insert new timers or remove
existing timers from the list of timers without having to delegate it to
the worker thread.
Change-Id: I2e615af83f64ac7e5024d7905432823044afe252
... instead of manually maintaining a linked list.
Store an iterator in the timer object so that it can be directly removed
if needed.
Change-Id: I38f1fbcdc6fe1b36a8adef6a95f36f8902a4f729
Move the timer resolution from a global define to an instance variable.
Use a default of the previous value. Switch all expiry values from
resolution-based to microseconds, and use 64-bit ints for all values.
Changes
timer::arm_absolute(u_int32_t wall_clock)
to
timer::arm()
Change-Id: I431220f378b4a9d2bd0f047d091ee5c8b3b72bfc
If there are no timers then it makes no senes to process ticks in real
time. Sleep up to 0.5 seconds in that case. When timers are added we
are immediately woken up through the conditional variable. Only setting
the shutdown flag would not wake up the thread, but a sleep time of half
a second should be an acceptable delay for shutdowns.
Analogous to 695d902841
Change-Id: I37adf078825470af99e6a7755df3d8786d3eeaa6
Signal the sleeping thread through a condition variable whenever a new
event has been added to the queue. We can then process these events
immediately instead of having to wait for the timer to expire.
(The decision to use a separate private mutex and an extra bool value
for the AmCondition class of course is highly questionable, but that's
what we have in the code base for now.)
Change-Id: I78b74f1152e36aa106906e962bc133f15093ea02
Use one method for wheel turning and another separate method for events
processing. This logically separates two indepenent processes.
In the event of the actual sleep time being different from the requested
sleep time, we do the wheel turning based on the number of required
ticks, but run the events processing only once, after the wall clock has
been brought up to date.
Change-Id: Ibbc6571a5a569050647efd1ba595c1fd08918409
We may end up sleeping shorter or longer than the desired sleep time. If
we ended up sleeping shorter, don't advance a tick, and if we ended up
sleeping significantly longer (more than one tick), advance multiple
ticks.
Change-Id: I0be20104e6243c89006367430a3663cc304486b9
Go to sleep even if the sleep time is less than 2 ms. This makes the
math a lot easier and shouldn't have a noticeable impact as this is
a somewhat unnecessary attempt at optimization.
Analogous to 292eb8cf1c
Change-Id: I6d936a4450967dcd76b4647f189aa3f71e5ed7ae
By making the wall_clock private to the timer thread, we force all
externally used timers to use relative timeout values. Amend the timer
class to keep both timeout values for clarity.
The previously existing member `expires` is the absolute timeout, but is
now initially left unset (zero). Instead the given timeout value is put
into the new member `expires_rel` and the absolute timeout is calculated
only once the timer is inserted into the wheel by adding the current
wall clock.
We add an extra getter function for the current wall clock only for
debugging and logging purposes.
This also turns the two expiry timestamps kept in the timer class
protected and private, delegating maintenance to getter and setter
methods.
Change-Id: Ia6baf552a1de94ba64f314e9123df172b45eed85
Change it into a wrapper that directly calls time() to eliminate the
need of the timer thread to continuously set unix_clock to the current
time. With vDSO the call to time() is sufficiently cheap.
Move constructor to header and remove default empty destructor.
Change-Id: Ib812a993da9340b9ded4fd97c81d762d9452c3ea
SIP message processing and Session event processing are now
enclosed in blocks with the form
vv <type> [<callid>|<ltag>] ... vv
^^ <type> [<callid>|<ltag>] ... ^^
where
<type> = M SIP message processing
<type> = S Session event processing
- static library sip_stack.a (with dependencies on the core).
- removed AmServer and moved SipCtrlInterface into the core directory.
- TODO:
- CMake support to make core/sip/sip_stack.a and link against it in the core.
- merge AmSipRequest/AmSipReply and sip_msg structures.
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1758 8eb893ce-cfd4-0310-b710-fb5ebe64c474