test2.cc revision 460998e0
1460998e0SShuo Chen#include "EventLoop.h" 2460998e0SShuo Chen 3460998e0SShuo Chenmuduo::EventLoop* g_loop; 4460998e0SShuo Chen 5460998e0SShuo Chenvoid threadFunc() 6460998e0SShuo Chen{ 7460998e0SShuo Chen g_loop->loop(); 8460998e0SShuo Chen} 9460998e0SShuo Chen 10460998e0SShuo Chenint main() 11460998e0SShuo Chen{ 12460998e0SShuo Chen muduo::EventLoop loop; 13460998e0SShuo Chen g_loop = &loop; 14460998e0SShuo Chen muduo::Thread t(threadFunc); 15460998e0SShuo Chen t.start(); 16460998e0SShuo Chen t.join(); 17460998e0SShuo Chen} 18