140161064SShuo Chen#include "EventLoop.h" 240161064SShuo Chen#include "thread/Thread.h" 340161064SShuo Chen#include <stdio.h> 440161064SShuo Chen 540161064SShuo Chenvoid threadFunc() 640161064SShuo Chen{ 740161064SShuo Chen printf("threadFunc(): pid = %d, tid = %d\n", 840161064SShuo Chen getpid(), muduo::CurrentThread::tid()); 940161064SShuo Chen 1040161064SShuo Chen muduo::EventLoop loop; 1140161064SShuo Chen loop.loop(); 1240161064SShuo Chen} 1340161064SShuo Chen 1440161064SShuo Chenint main() 1540161064SShuo Chen{ 1640161064SShuo Chen printf("main(): pid = %d, tid = %d\n", 1740161064SShuo Chen getpid(), muduo::CurrentThread::tid()); 1840161064SShuo Chen 1940161064SShuo Chen muduo::EventLoop loop; 2040161064SShuo Chen 2140161064SShuo Chen muduo::Thread thread(threadFunc); 2240161064SShuo Chen thread.start(); 2340161064SShuo Chen 2440161064SShuo Chen loop.loop(); 2540161064SShuo Chen pthread_exit(NULL); 2640161064SShuo Chen} 27