|
|
@ -84,6 +84,7 @@ class SrsThread
|
|
|
|
{
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
st_thread_t tid;
|
|
|
|
st_thread_t tid;
|
|
|
|
|
|
|
|
int _cid;
|
|
|
|
bool loop;
|
|
|
|
bool loop;
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
ISrsThreadHandler* handler;
|
|
|
|
ISrsThreadHandler* handler;
|
|
|
@ -97,6 +98,12 @@ public:
|
|
|
|
SrsThread(ISrsThreadHandler* thread_handler, int64_t interval_us);
|
|
|
|
SrsThread(ISrsThreadHandler* thread_handler, int64_t interval_us);
|
|
|
|
virtual ~SrsThread();
|
|
|
|
virtual ~SrsThread();
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* get the context id. @see: ISrsThreadContext.get_id().
|
|
|
|
|
|
|
|
* used for parent thread to get the id.
|
|
|
|
|
|
|
|
* @remark when start thread, parent thread will block and wait for this id ready.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
virtual int cid();
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* start the thread, invoke the cycle of handler util
|
|
|
|
* start the thread, invoke the cycle of handler util
|
|
|
|
* user stop the thread.
|
|
|
|
* user stop the thread.
|
|
|
|