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