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