1b37003a7SShuo Chen// excerpts from http://code.google.com/p/muduo/
2b37003a7SShuo Chen//
3b37003a7SShuo Chen// Use of this source code is governed by a BSD-style license
4b37003a7SShuo Chen// that can be found in the License file.
5b37003a7SShuo Chen//
6b37003a7SShuo Chen// Author: Shuo Chen (chenshuo at chenshuo dot com)
7b37003a7SShuo Chen
8b37003a7SShuo Chen#ifndef MUDUO_NET_EVENTLOOPTHREAD_H
9b37003a7SShuo Chen#define MUDUO_NET_EVENTLOOPTHREAD_H
10b37003a7SShuo Chen
11b37003a7SShuo Chen#include "thread/Condition.h"
12b37003a7SShuo Chen#include "thread/Mutex.h"
13b37003a7SShuo Chen#include "thread/Thread.h"
14b37003a7SShuo Chen
15b37003a7SShuo Chen#include <boost/noncopyable.hpp>
16b37003a7SShuo Chen
17b37003a7SShuo Chennamespace muduo
18b37003a7SShuo Chen{
19b37003a7SShuo Chen
20b37003a7SShuo Chenclass EventLoop;
21b37003a7SShuo Chen
22b37003a7SShuo Chenclass EventLoopThread : boost::noncopyable
23b37003a7SShuo Chen{
24b37003a7SShuo Chen public:
25b37003a7SShuo Chen  EventLoopThread();
26b37003a7SShuo Chen  ~EventLoopThread();
27b37003a7SShuo Chen  EventLoop* startLoop();
28b37003a7SShuo Chen
29b37003a7SShuo Chen private:
30b37003a7SShuo Chen  void threadFunc();
31b37003a7SShuo Chen
32b37003a7SShuo Chen  EventLoop* loop_;
33b37003a7SShuo Chen  bool exiting_;
34b37003a7SShuo Chen  Thread thread_;
35b37003a7SShuo Chen  MutexLock mutex_;
36b37003a7SShuo Chen  Condition cond_;
37b37003a7SShuo Chen};
38b37003a7SShuo Chen
39b37003a7SShuo Chen}
40b37003a7SShuo Chen
41b37003a7SShuo Chen#endif  // MUDUO_NET_EVENTLOOPTHREAD_H
42b37003a7SShuo Chen
43