//////////////////////////////////////////////////////////////////////////// // CDmyThread クラスのインプリメンテーション // //////////////////////////////////////////////////////////////////////////// #include #include #include "DmyThread.h" #include "Thread.h" //////////////////////////////////////////////////////////////////////////// // 構築/破棄 //////////////////////////////////////////////////////////////////////////// CDmyThread::CDmyThread() : semaWait( 1 ) { } CDmyThread::~CDmyThread() { } //////////////////////////////////////////////////////////////////////////// // メソッド //////////////////////////////////////////////////////////////////////////// // 開始 void CDmyThread::OnStart( CThread *pTh ) { pThread = pTh; semaWait.P(); } // スレッドのエントリポイント void CDmyThread::run() { } // 終了 void CDmyThread::OnExit() { pThread = NULL; semaWait.V(); } pthread_t CDmyThread::GetThreadID() const { return pThread->GetThreadID(); } // このスレッドの終了を待ち合わせる void CDmyThread::Wait() { // このスレッドの終了を待ち合わせる semaWait.P(); semaWait.V(); }