@@ -27,7 +27,7 @@ using namespace std;
2727class SampleWorkerThread : public WorkerThread
2828{
2929public:
30- int id;
30+ int id;
3131
3232 unsigned virtual executeThis ()
3333 {
@@ -39,15 +39,15 @@ class SampleWorkerThread : public WorkerThread
3939 }
4040
4141
42- SampleWorkerThread (int id) : WorkerThread(id), id(id)
43- {
42+ SampleWorkerThread (int id) : WorkerThread(id), id(id)
43+ {
4444// cout << "Creating SampleWorkerThread " << id << "\t address=" << this << endl;
45- }
45+ }
4646
47- ~SampleWorkerThread ()
48- {
47+ ~SampleWorkerThread ()
48+ {
4949// cout << "Deleting SampleWorkerThread " << id << "\t address=" << this << endl;
50- }
50+ }
5151};
5252
5353
@@ -59,26 +59,26 @@ int main(int argc, char **argv)
5959 myPool->initializeThreads ();
6060
6161 // We will count time elapsed after initializeThreads()
62- time_t t1=time (NULL );
62+ time_t t1=time (NULL );
6363
6464 // Lets start bullying ThreadPool with tonnes of work !!!
6565 for (unsigned int i=0 ;i<ITERATIONS;i++){
6666 SampleWorkerThread* myThread = new SampleWorkerThread (i);
6767// cout << "myThread[" << myThread->id << "] = [" << myThread << "]" << endl;
6868 myPool->assignWork (myThread);
6969 }
70-
70+
7171 // destroyPool(int maxPollSecs)
7272 // Before actually destroying the ThreadPool, this function checks if all the pending work is completed.
7373 // If the work is still not done, then it will check again after maxPollSecs
7474 // The default value for maxPollSecs is 2 seconds.
7575 // And ofcourse the user is supposed to adjust it for his needs.
76-
77- myPool->destroyPool (2 );
7876
79- time_t t2=time (NULL );
80- cout << t2-t1 << " seconds elapsed\n " << endl;
77+ myPool->destroyPool (2 );
78+
79+ time_t t2=time (NULL );
80+ cout << t2-t1 << " seconds elapsed\n " << endl;
8181 delete myPool;
82-
83- return 0 ;
82+
83+ return 0 ;
8484}
0 commit comments