1bfe73648SShuo Chen#include "EventLoop.h" 2bfe73648SShuo Chen#include "thread/Thread.h" 3bfe73648SShuo Chen#include <stdio.h> 4bfe73648SShuo Chen 5bfe73648SShuo Chenvoid threadFunc() 6bfe73648SShuo Chen{ 70615e80eSShuo Chen printf("threadFunc(): pid = %d, tid = %d\n", 80615e80eSShuo Chen getpid(), muduo::CurrentThread::tid()); 9bfe73648SShuo Chen 10bfe73648SShuo Chen muduo::EventLoop loop; 11bfe73648SShuo Chen loop.loop(); 12bfe73648SShuo Chen} 13bfe73648SShuo Chen 14bfe73648SShuo Chenint main() 15bfe73648SShuo Chen{ 160615e80eSShuo Chen printf("main(): pid = %d, tid = %d\n", 170615e80eSShuo Chen getpid(), muduo::CurrentThread::tid()); 18bfe73648SShuo Chen 19bfe73648SShuo Chen muduo::EventLoop loop; 20bfe73648SShuo Chen 21bfe73648SShuo Chen muduo::Thread thread(threadFunc); 22bfe73648SShuo Chen thread.start(); 23bfe73648SShuo Chen 24bfe73648SShuo Chen loop.loop(); 25bfe73648SShuo Chen pthread_exit(NULL); 26bfe73648SShuo Chen} 27