12745a763SShuo Chen// excerpts from http://code.google.com/p/muduo/ 22745a763SShuo Chen// 32745a763SShuo Chen// Use of this source code is governed by a BSD-style license 42745a763SShuo Chen// that can be found in the License file. 52745a763SShuo Chen// 62745a763SShuo Chen// Author: Shuo Chen (chenshuo at chenshuo dot com) 72745a763SShuo Chen 82745a763SShuo Chen#ifndef MUDUO_NET_EVENTLOOPTHREAD_H 92745a763SShuo Chen#define MUDUO_NET_EVENTLOOPTHREAD_H 102745a763SShuo Chen 112745a763SShuo Chen#include "thread/Condition.h" 122745a763SShuo Chen#include "thread/Mutex.h" 132745a763SShuo Chen#include "thread/Thread.h" 142745a763SShuo Chen 152745a763SShuo Chen#include <boost/noncopyable.hpp> 162745a763SShuo Chen 172745a763SShuo Chennamespace muduo 182745a763SShuo Chen{ 192745a763SShuo Chen 202745a763SShuo Chenclass EventLoop; 212745a763SShuo Chen 222745a763SShuo Chenclass EventLoopThread : boost::noncopyable 232745a763SShuo Chen{ 242745a763SShuo Chen public: 252745a763SShuo Chen EventLoopThread(); 262745a763SShuo Chen ~EventLoopThread(); 272745a763SShuo Chen EventLoop* startLoop(); 282745a763SShuo Chen 292745a763SShuo Chen private: 302745a763SShuo Chen void threadFunc(); 312745a763SShuo Chen 322745a763SShuo Chen EventLoop* loop_; 332745a763SShuo Chen bool exiting_; 342745a763SShuo Chen Thread thread_; 352745a763SShuo Chen MutexLock mutex_; 362745a763SShuo Chen Condition cond_; 372745a763SShuo Chen}; 382745a763SShuo Chen 392745a763SShuo Chen} 402745a763SShuo Chen 412745a763SShuo Chen#endif // MUDUO_NET_EVENTLOOPTHREAD_H 422745a763SShuo Chen 43