首页 > 其他 > 详细

Poco 线程

时间:2014-02-25 14:54:33      阅读:375      评论:0      收藏:0      [点我收藏+]
#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;
}

Poco 线程

原文:http://blog.csdn.net/haifengzhilian/article/details/19826065

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!