Anna's modifications

This commit is contained in:
2017-08-11 15:52:08 +02:00
parent 0b6aeac364
commit 52e1bd32b9
13 changed files with 623 additions and 10 deletions

View File

@ -49,9 +49,9 @@ int ThreadPool::initialize_threadpool(){
m_threads.push_back(tid);
while(!thread_started);
}
#ifdef VERBOSE
#ifdef VERBOSE
cout << m_pool_size << " threads created by the thread pool" << endl;
#endif
#endif
return m_pool_size;
}
@ -87,11 +87,11 @@ int ThreadPool::destroy_threadpool(){
void* ThreadPool::execute_thread(){
//for debugging seting ithread value
// int ithread = current_thread_number;
//int ithread = current_thread_number;
thread_started = true;
Task* task = NULL;
m_tasks_loaded = false;
/*cout << "Starting thread " << pthread_self() << endl;*/
//cout << "Starting thread " << pthread_self() << endl;
while(true) {
// Try to pick a task
/*cout << "Locking: " << pthread_self() << endl;*/
@ -122,7 +122,7 @@ void* ThreadPool::execute_thread(){
//cout<<"***"<<ithread<<" checking out semaphore done address:"<<&semDone<<endl;
/*cout << ithread <<" Executing thread " << pthread_self() << endl;*/
// cout << ithread <<" Executing thread " << pthread_self() << endl;
// execute the task
(*task)(); // could also do task->run(arg);
/*cout << ithread <<" Done executing thread " << pthread_self() << endl;*/