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 std::condition_variable and std::mutex to implement AmCondition.
Only bools are used for conditions in the code, so make it not a
template.
Change-Id: I57d67492e29c220a5ce941ef67d142b34dcebbff
AmEventProcessingThread processes events posted
in the event queue until either server shutdown
is signaled or processing is requested to stop
with the stop_processing function.
Override the onEvent(AmEvent* ev) method, create
an object, start() it and post events to it.
If you need queue policing (e.g. overflow protection),
override police_event() function.
to use it, set USE_THREADPOOL in Makefile.defs and configure thread pool
size with session_processor_threads= parameter in sems.conf :
+# compile with session thread pool support?
+# use this for very high concurrent call count
+# applications (e.g. for signaling only)
+# if compiled with thread pool, there will be a
+# thread pool of configurable size processing the
+# signaling and application logic of the calls.
+# if compiled without thread pool support, every
+# session will have its own thread.
+#
+#USE_THREADPOOL = yes
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1782 8eb893ce-cfd4-0310-b710-fb5ebe64c474
- active sessions and other event receivers
get a SystemEvent::ServerShutdown,
default behaviour of AmSession is setStopped()
- session container waits for all sessions to be ended
- signaling server, rtp receiver, media processor, event dispatcher
are stopped and deleted
based on a patch by Rui Jin Zheng rjzheng at boronetworks dot com
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1087 8eb893ce-cfd4-0310-b710-fb5ebe64c474
- removed AmSIPEventHandler (its functionalities are now in AmEventDispatcher).
- added possibility for each plug-in to receive out-of-dialog messages (any kind).
- added possibility to handle dialogs without creating a session (=AmSession).
git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1006 8eb893ce-cfd4-0310-b710-fb5ebe64c474