0
#ifndef FFMPEG_THREAD_H
 #define FFMPEG_THREAD_H

#include <pthread.h>

class Thread
{
public:
    Thread();
    ~Thread();

    void                        start();
    void                        startAsync();
    int                         wait();

    void                        waitOnNotify();
    void                        notify();
    virtual void                stop();

protected:
    bool                        mRunning;

    virtual void                handleRun(void* ptr);

private:
    pthread_t                   mThread;
    pthread_mutex_t             mLock;
    pthread_cond_t              mCondition;

    static void*                startThread(void* ptr);
};

#endif //FFMPEG_DECODER_H



 void* Thread::startThread(void* ptr)
{

    Thread* thread = (Thread *) ptr;
    thread->mRunning = true;
    thread->handleRun(ptr);
    thread->mRunning = false;

}

void Thread::handleRun(void* ptr)
{
}

このコード スニペットでは、thread.cpp. スレッド オブジェクト内で実行を開始し、HandleRun 関数を持っていますが、空です。HandleRun 空の関数の目的は何ですか? それは何もしません。

4

1 に答える 1