#include "Poco/ConsoleChannel.h" #include "Poco/FormattingChannel.h" #include "Poco/PatternFormatter.h" #include "Poco/Logger.h" #include "Poco/AutoPtr.h" #include "Poco/FileChannel.h" #include "Poco/Thread.h" #include "Poco/Runnable.h" using Poco::ConsoleChannel; using Poco::FormattingChannel; using Poco::PatternFormatter; using Poco::Logger; using Poco::AutoPtr; using Poco::FileChannel; using Poco::Thread; class HelloRunable:public Poco::Runnable { virtual void run() { std::cout << "Hello ...." << std::endl; } }; class WorldRunable:public Poco::Runnable { virtual void run() { std::cout << "World ...." << std::endl; } }; int main(int argc, char** argv) { HelloRunable hello; WorldRunable world; Poco::Thread thread1; Poco::Thread thread2; thread1.start(hello); thread2.start(world); //thread.start(world); thread1.join(); thread2.join(); return 0; }
原文:http://blog.csdn.net/haifengzhilian/article/details/19826065