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