19a1e991dSShuo Chen#include "EventLoop.h" 29a1e991dSShuo Chen#include "thread/Thread.h" 39a1e991dSShuo Chen#include <stdio.h> 49a1e991dSShuo Chen 59a1e991dSShuo Chenvoid threadFunc() 69a1e991dSShuo Chen{ 70615e80eSShuo Chen printf("threadFunc(): pid = %d, tid = %d\n", 80615e80eSShuo Chen getpid(), muduo::CurrentThread::tid()); 99a1e991dSShuo Chen 109a1e991dSShuo Chen muduo::EventLoop loop; 119a1e991dSShuo Chen loop.loop(); 129a1e991dSShuo Chen} 139a1e991dSShuo Chen 149a1e991dSShuo Chenint main() 159a1e991dSShuo Chen{ 160615e80eSShuo Chen printf("main(): pid = %d, tid = %d\n", 170615e80eSShuo Chen getpid(), muduo::CurrentThread::tid()); 189a1e991dSShuo Chen 199a1e991dSShuo Chen muduo::EventLoop loop; 209a1e991dSShuo Chen 219a1e991dSShuo Chen muduo::Thread thread(threadFunc); 229a1e991dSShuo Chen thread.start(); 239a1e991dSShuo Chen 249a1e991dSShuo Chen loop.loop(); 259a1e991dSShuo Chen pthread_exit(NULL); 269a1e991dSShuo Chen} 27