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