test2.cc revision 40161064
140161064SShuo Chen#include "EventLoop.h" 240161064SShuo Chen#include "thread/Thread.h" 340161064SShuo Chen 440161064SShuo Chenmuduo::EventLoop* g_loop; 540161064SShuo Chen 640161064SShuo Chenvoid threadFunc() 740161064SShuo Chen{ 840161064SShuo Chen g_loop->loop(); 940161064SShuo Chen} 1040161064SShuo Chen 1140161064SShuo Chenint main() 1240161064SShuo Chen{ 1340161064SShuo Chen muduo::EventLoop loop; 1440161064SShuo Chen g_loop = &loop; 1540161064SShuo Chen muduo::Thread t(threadFunc); 1640161064SShuo Chen t.start(); 1740161064SShuo Chen t.join(); 1840161064SShuo Chen} 19