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