12a18e699SShuo Chen#include "EventLoop.h" 22a18e699SShuo Chen#include "thread/Thread.h" 32a18e699SShuo Chen#include <stdio.h> 42a18e699SShuo Chen 52a18e699SShuo Chenvoid threadFunc() 62a18e699SShuo Chen{ 72a18e699SShuo Chen printf("threadFunc(): pid = %d, tid = %d\n", 82a18e699SShuo Chen getpid(), muduo::CurrentThread::tid()); 92a18e699SShuo Chen 102a18e699SShuo Chen muduo::EventLoop loop; 112a18e699SShuo Chen loop.loop(); 122a18e699SShuo Chen} 132a18e699SShuo Chen 142a18e699SShuo Chenint main() 152a18e699SShuo Chen{ 162a18e699SShuo Chen printf("main(): pid = %d, tid = %d\n", 172a18e699SShuo Chen getpid(), muduo::CurrentThread::tid()); 182a18e699SShuo Chen 192a18e699SShuo Chen muduo::EventLoop loop; 202a18e699SShuo Chen 212a18e699SShuo Chen muduo::Thread thread(threadFunc); 222a18e699SShuo Chen thread.start(); 232a18e699SShuo Chen 242a18e699SShuo Chen loop.loop(); 252a18e699SShuo Chen pthread_exit(NULL); 262a18e699SShuo Chen} 27