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