12a18e699SShuo Chen// excerpts from http://code.google.com/p/muduo/
22a18e699SShuo Chen//
32a18e699SShuo Chen// Use of this source code is governed by a BSD-style license
42a18e699SShuo Chen// that can be found in the License file.
52a18e699SShuo Chen//
62a18e699SShuo Chen// Author: Shuo Chen (chenshuo at chenshuo dot com)
72a18e699SShuo Chen
82a18e699SShuo Chen#ifndef MUDUO_NET_EVENTLOOPTHREAD_H
92a18e699SShuo Chen#define MUDUO_NET_EVENTLOOPTHREAD_H
102a18e699SShuo Chen
112a18e699SShuo Chen#include "thread/Condition.h"
122a18e699SShuo Chen#include "thread/Mutex.h"
132a18e699SShuo Chen#include "thread/Thread.h"
142a18e699SShuo Chen
152a18e699SShuo Chen#include <boost/noncopyable.hpp>
162a18e699SShuo Chen
172a18e699SShuo Chennamespace muduo
182a18e699SShuo Chen{
192a18e699SShuo Chen
202a18e699SShuo Chenclass EventLoop;
212a18e699SShuo Chen
222a18e699SShuo Chenclass EventLoopThread : boost::noncopyable
232a18e699SShuo Chen{
242a18e699SShuo Chen public:
252a18e699SShuo Chen  EventLoopThread();
262a18e699SShuo Chen  ~EventLoopThread();
272a18e699SShuo Chen  EventLoop* startLoop();
282a18e699SShuo Chen
292a18e699SShuo Chen private:
302a18e699SShuo Chen  void threadFunc();
312a18e699SShuo Chen
322a18e699SShuo Chen  EventLoop* loop_;
332a18e699SShuo Chen  bool exiting_;
342a18e699SShuo Chen  Thread thread_;
352a18e699SShuo Chen  MutexLock mutex_;
362a18e699SShuo Chen  Condition cond_;
372a18e699SShuo Chen};
382a18e699SShuo Chen
392a18e699SShuo Chen}
402a18e699SShuo Chen
412a18e699SShuo Chen#endif  // MUDUO_NET_EVENTLOOPTHREAD_H
422a18e699SShuo Chen
43