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