test2.cc revision 354280cf
1354280cfSShuo Chen#include "EventLoop.h" 2354280cfSShuo Chen#include "thread/Thread.h" 3354280cfSShuo Chen 4354280cfSShuo Chenmuduo::EventLoop* g_loop; 5354280cfSShuo Chen 6354280cfSShuo Chenvoid threadFunc() 7354280cfSShuo Chen{ 8354280cfSShuo Chen g_loop->loop(); 9354280cfSShuo Chen} 10354280cfSShuo Chen 11354280cfSShuo Chenint main() 12354280cfSShuo Chen{ 13354280cfSShuo Chen muduo::EventLoop loop; 14354280cfSShuo Chen g_loop = &loop; 15354280cfSShuo Chen muduo::Thread t(threadFunc); 16354280cfSShuo Chen t.start(); 17354280cfSShuo Chen t.join(); 18354280cfSShuo Chen} 19