Apps registered through registerFactory4App or registerApplication get
put into the same name2app map as apps registered from loadAppPlugIn.
For consistent references, refcount these as well.
Change-Id: I9b616257555533a8ea5847a95b4fa5c0f2e91877
Increase refcount also for DI plugins and log plugins, as they also have
their refcount decreased for unloading.
Change-Id: I0b9d2f671a2a1acda4e5210855aafd47f8cb62c3
The `di_method` object accesses fields of the `s` server in its dtor.
Therefore delete that one first, and `s` second.
Change-Id: Ib5f86753c7801b0b67d92e4c0f97464c2aecdaed
New class inheriting from AmEventQueueBase to be used in threads that
run in a loop processing events until thread shutdown is requested.
Change-Id: Ib63837997659a944fc217712ff2472c7900e7525
Rename most of it to AmEventQueueBase. Remove the integrated mutex and
condition variable.
Add refactored AmEventQueue, which now inherits from AmEventQueueBase
and includes the previously existing mutex and condition variable.
No behavioural or usage difference, other than that now AmEventQueueBase
must be used as base class where previously AmEventQueue was used.
Remove pointless locking in dtor.
Use lock guards where appropriate.
Introduce virtual ::shouldSleep() to determine whether a looping thread
should sleep and wait for an event, or go to process pending events.
Change-Id: Ib90ff47e0c9c279e54f23cd33bf31042fdf08015
AmThread already inherits atomic_ref_cnt virtually. For cases of child
classes inheriting both AmThread and AmEventQueue, make sure only one
instance of atomic_ref_cnt is present.
Change-Id: I611db51f0b36e7cca2bcdfe8befa20bce975030b
Use AmMutex facilities to protect members dictating whether to run or
not. Replaces `runcond`, `process_sessions_mut`, and ::on_stop().
Remove redundant wake-up.
Change-Id: I75c5c4ff2be2b66b36c7354c1e127bc4f5d9993c
This module initialises and starts the StatsUDPServer. Stop its worker
when the module is destroyed.
Change-Id: I265d7ee103866a5946b066e4e7d42376e3510cac
Use the new AmThread facilities to get notified about shutdown. Use the
new `run_mut` in place of the existing mutex to protect `thread_list`
Stop watcher thread from main thread on shutdown.
Change-Id: I4214a5d2324dd7d7d5a424e425d3e2d0ef20aa14
Add a central mutex and condition variable to AmThread, which can be
used by subclasses in their ::run() to determine whether they should
sleep, run, or shut down. This will replace identical mechanism in
subclasses that have this implemented on their own.
Subclasses which don't need this are not affected.
Add `_state` to the list of members protected by this mutex, obsoleting
the need for atomic ops.
Refactor `_joined` as an enum state, also protected by run_mutex,
replacing the separate mutex. Use run_cond as signal to wake up thread
waiting on the join to the complete.
Notify this cond on shutdown, after setting the state to "stopping."
Add ::stop_requested_unlocked() for threads which use `run_mut`.
Change-Id: I0b640b54c9f601e86cbb25413cacb67e31fbe913
If the CallLeg isn't SIP relayable, then makes no sense
to relay INVITE to the other leg, otherwise it gets stuck
on the other side.
Change-Id: I43dff24981084885a20f697537419a6dac75b806
When this leg being reconnected, is still in progress
of posting remaining events to update the other side
(the reconnect originator), don't consider it as
sip relay ready. Otherwise any INVITE updates coming
to it, will lead to stumbled INVITEs coming to the other leg,
but without a possibility to use it here (because e.g. this
other side never seen 200OK answer even).
Change-Id: I183d0f70433c156030de38238db395e2c1372352
In the following funcs:
- AmB2BSession::acceptPendingInviteB2B()
- AmB2BSession::acceptPendingInvite()
That ensures we do not interfere into SDP
when creating fictitious replies.
Change-Id: Ic2e6ccc273cd6079c4b21839cfee38455e60ebc2
The parsing code expect a null-terminated string. Make sure the string
is.
Use correct ssize_t as return value.
Change-Id: I2590dead0db5ca839ebe5fe7506b4edfe524d164
Expose the queue_mut for external users.
Supposed to only be used with a snapshot mechanism,
because it is partially a data incapsulation violation.
The container itself and lock mechanism is meant
to be reworked in the future, to not expose locks anymore.
Change-Id: I4f8b90ab60f3ab564e2b858c588a94eb78da6acf
A a mechanism to get the AmSession object
stored polymorphically on the EvQueueMap.
Follow the classes hierarchy:
AmEventQueueInterface -> AmEventQueue -> AmSession
to retrieve AmSession by down casting it from base class.
When retrieved, acquire the snapshot dedicated lock
to prevent other thread destroying this gotten AmSession.
As soon as AmSessionSnapshot is ready,
release the lock and let other (real owner) thread do anything with it.
Left corner cases:
- by the time the AmEventQueueInterface is retrieved and down-casted
into the AmSession, returned to the user and the snapshot lock
is acquired, this thread can simply destroy the AmSession object
- this is an undefined behavior
Change-Id: Ia62b5cb27618e2c077ae5a247bb914be74e17fa9
This makes sure we use the system library, with any updates coming from
upstream, including security fixes.
Change-Id: I03a33869bcd0c3ccc09cf8fafc4258e3a65a2f6b
This makes sure we use the system library, with any updates coming from
upstream, including security fixes.
Change-Id: I3bc01b99fa4c5f107d28a819dc0e1c1eac155e91
Use static_cast for the up-cast of AmSession.
Static cast is equivalent to the C-style implicit cast,
when doing an up-cast, but C-style cast is less clear.
So just use static_cast here.
Change-Id: I7a41f2ee389a4bd48734a75a0d736d8d5a75ed28
Add spaces around variables assignments to make it clear that these are
make variables and equal signs to not bind to multiple variables.
Split multivalue variables into one value per line to make it easier to
sort and modify entries without creating unrelated diff damage.
Change-Id: I87532c3446ae61cc5003ab0714f6b36f89429b56
These variables used to be shell variables passed to the make
invocations in various rules. But those got refactored into make
variables. The problem is that in make the equal sign does not bind
according to surrounding lack of spaces, and the first equal sign
will mark an assignment for the rest of the string including subsequent
equal signs.
The other problem is with the CPPFLAGS assignment where it will assign
append the value and then subsequent conditional assignments will not
take place. Switch to use DEB_CPPFLAGS_APPEND, which was designed
precisely for this purpose.
Fixes: commit 9b5df2495e
Change-Id: Ice82295903729fed3f0fb11f750f3f2fdde2e09f