reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
resip::InterruptableStackThread Class Reference

This class is used to create a thread to run the SipStack in. More...

#include <InterruptableStackThread.hxx>

Inheritance diagram for resip::InterruptableStackThread:
[legend]

Public Member Functions

 InterruptableStackThread (SipStack &stack, SelectInterruptor &si)
 
virtual ~InterruptableStackThread ()
 
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 void buildFdSet (FdSet &fdset)
 
virtual unsigned int getTimeTillNextProcessMS () const
 
virtual void process (FdSet &fdset)
 

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
 

Detailed Description

This class is used to create a thread to run the SipStack in.

The thread provides cycles to the SipStack by calling process. Process is called when select returns a signaled file descriptor.

This implementation improves on StackThread, by providing a fully blocking architecture (ie. no need to wake up every 25ms), since posting to TransactionState will cause the SelectInterruptor to be invoked.

You must register SelectInterrupter as an AsyncProcessHandler on the SipStack in order to use this class. This is done by providing SelectInterrupter to the constructor of SipStack. This should be the same SelectInterrupter provided when constructing this class.

Definition at line 28 of file InterruptableStackThread.hxx.

Constructor & Destructor Documentation

◆ InterruptableStackThread()

InterruptableStackThread::InterruptableStackThread ( SipStack &  stack,
SelectInterruptor &  si 
)

Definition at line 11 of file InterruptableStackThread.cxx.

◆ ~InterruptableStackThread()

InterruptableStackThread::~InterruptableStackThread ( )
virtual

Definition at line 16 of file InterruptableStackThread.cxx.

Member Function Documentation

◆ buildFdSet()

void InterruptableStackThread::buildFdSet ( FdSet &  fdset)
protectedvirtual

Definition at line 82 of file InterruptableStackThread.cxx.

◆ getTimeTillNextProcessMS()

unsigned int InterruptableStackThread::getTimeTillNextProcessMS ( ) const
protectedvirtual

Definition at line 87 of file InterruptableStackThread.cxx.

◆ process()

void InterruptableStackThread::process ( FdSet &  fdset)
protectedvirtual

Definition at line 94 of file InterruptableStackThread.cxx.

◆ shutdown()

void InterruptableStackThread::shutdown ( )
virtual

Reimplemented from resip::ThreadIf.

Definition at line 75 of file InterruptableStackThread.cxx.

◆ thread()

void InterruptableStackThread::thread ( )
virtual

Implements resip::ThreadIf.

Definition at line 37 of file InterruptableStackThread.cxx.


The documentation for this class was generated from the following files: