1460998e0SShuo Chen#include "EventLoop.h" 2566406ccSShuo Chen#include "thread/Thread.h" 3460998e0SShuo Chen 4460998e0SShuo Chenmuduo::EventLoop* g_loop; 5460998e0SShuo Chen 6460998e0SShuo Chenvoid threadFunc() 7460998e0SShuo Chen{ 8460998e0SShuo Chen g_loop->loop(); 9460998e0SShuo Chen} 10460998e0SShuo Chen 11460998e0SShuo Chenint main() 12460998e0SShuo Chen{ 13460998e0SShuo Chen muduo::EventLoop loop; 14460998e0SShuo Chen g_loop = &loop; 15460998e0SShuo Chen muduo::Thread t(threadFunc); 16460998e0SShuo Chen t.start(); 17460998e0SShuo Chen t.join(); 18460998e0SShuo Chen} 19