1b37003a7SShuo Chen#include "EventLoop.h" 2b37003a7SShuo Chen#include "thread/Thread.h" 3b37003a7SShuo Chen 4b37003a7SShuo Chenmuduo::EventLoop* g_loop; 5b37003a7SShuo Chen 6b37003a7SShuo Chenvoid threadFunc() 7b37003a7SShuo Chen{ 8b37003a7SShuo Chen g_loop->loop(); 9b37003a7SShuo Chen} 10b37003a7SShuo Chen 11b37003a7SShuo Chenint main() 12b37003a7SShuo Chen{ 13b37003a7SShuo Chen muduo::EventLoop loop; 14b37003a7SShuo Chen g_loop = &loop; 15b37003a7SShuo Chen muduo::Thread t(threadFunc); 16b37003a7SShuo Chen t.start(); 17b37003a7SShuo Chen t.join(); 18b37003a7SShuo Chen} 19