|
reSIProcate
SIP stack, Dialog Usage Manager and related libraries
|
This class creates a thread in which to run one or more SipStacks. More...
#include <EventStackThread.hxx>
Public Member Functions | |
| EventStackThread (EventThreadInterruptor &si, FdPollGrp &pollGrp) | |
| EventStackThread (SipStack &stack, EventThreadInterruptor &si, FdPollGrp &pollGrp) | |
| virtual | ~EventStackThread () |
| void | addStack (SipStack &stack) |
| virtual void | thread () |
| virtual void | shutdown () |
Public Member Functions inherited from resip::ThreadIf | |
| ThreadIf () | |
| virtual | ~ThreadIf () |
| virtual void | run () |
| void | join () |
| void | detach () |
| virtual bool | waitForShutdown (int ms) const |
| bool | isShutdown () const |
Protected Member Functions | |
| virtual unsigned int | getTimeTillNextProcessMS () const |
| virtual void | afterProcess () |
Additional Inherited Members | |
Public Types inherited from resip::ThreadIf | |
| typedef std::thread::id | Id |
| typedef pthread_key_t | TlsKey |
| typedef void | TlsDestructor(void *) |
Static Public Member Functions inherited from resip::ThreadIf | |
| static Id | selfId () |
| static int | tlsKeyCreate (TlsKey &key, TlsDestructor *destructor) |
| This function follows pthread_key_create() signature. | |
| static int | tlsKeyDelete (TlsKey key) |
| This function follows pthread_key_delete() signature. | |
| static int | tlsSetValue (TlsKey key, const void *val) |
| This function follows pthread_setspecific() signature. | |
| static void * | tlsGetValue (TlsKey key) |
| This function follows pthread_getspecific() signature. | |
Protected Attributes inherited from resip::ThreadIf | |
| std::shared_ptr< std::thread > | mThreadObj |
| Id | mId |
| bool | mShutdown |
| Mutex | mShutdownMutex |
| Condition | mShutdownCondition |
This class creates a thread in which to run one or more SipStacks.
The thread provides cycles to the stack(s). It provides cycles in 3 ways:
This implementation improves on StackThread and IntrruptableStackThread, by using the epoll() based system call (if available) provided by the FdPoll class.
Note that this is different than the InterruptableStackThread and simple StackThread in that it doesn't use the buildFdSet()/process() flow.
You must register {si} as an AsyncProcessHandler on the stacks in order to use this class. The same {si} instance must be used for all stacks.
Definition at line 40 of file EventStackThread.hxx.
| EventStackThread::EventStackThread | ( | EventThreadInterruptor & | si, |
| FdPollGrp & | pollGrp | ||
| ) |
Definition at line 37 of file EventStackThread.cxx.
| EventStackThread::EventStackThread | ( | SipStack & | stack, |
| EventThreadInterruptor & | si, | ||
| FdPollGrp & | pollGrp | ||
| ) |
Definition at line 43 of file EventStackThread.cxx.
|
virtual |
Definition at line 51 of file EventStackThread.cxx.
| void EventStackThread::addStack | ( | SipStack & | stack | ) |
Definition at line 57 of file EventStackThread.cxx.
|
protectedvirtual |
Definition at line 105 of file EventStackThread.cxx.
|
protectedvirtual |
Definition at line 99 of file EventStackThread.cxx.
|
virtual |
Reimplemented from resip::ThreadIf.
Definition at line 92 of file EventStackThread.cxx.
|
virtual |
Implements resip::ThreadIf.
Definition at line 63 of file EventStackThread.cxx.