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