Created
December 10, 2012 03:25
Revisions
-
sumnjc created this gist
Dec 10, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ // sample of using POCO's Thread #include "Poco/Runnable.h" #include "Poco/Thread.h" #include <iostream> using namespace std; class Worker:public Poco::Runnable{ public: Worker(int n):_id(n){} virtual void run() { cout << "i'm worker:" << _id << endl; } private: int _id; }; int main(int argc, char **argv) { Worker work1(1); Worker work2(2); Poco::Thread thread1; Poco::Thread thread2; thread1.start(work1); thread2.start(work2); thread1.join(); thread2.join(); return 0; }