File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ ThreadPool::ThreadPool(unsigned int num_thread)
3232{
3333 pthread_mutex_lock (&mutexSync);
3434 _top_index = 0 ;
35- bottomIndex = 0 ;
35+ _bottom_index = 0 ;
3636 incompleteWork = 0 ;
3737 sem_init (&_available_work, 0 , 0 );
3838 sem_init (&_available_thread, 0 , queueSize);
@@ -98,11 +98,11 @@ bool ThreadPool::fetchWork(WorkerThread **workerArg)
9898 sem_wait (&_available_work);
9999
100100 pthread_mutex_lock (&mutexSync);
101- WorkerThread * workerThread = _worker_queue[bottomIndex ];
102- _worker_queue[bottomIndex ] = NULL ;
101+ WorkerThread * workerThread = _worker_queue[_bottom_index ];
102+ _worker_queue[_bottom_index ] = NULL ;
103103 *workerArg = workerThread;
104104 if (queueSize !=1 )
105- bottomIndex = (bottomIndex +1 ) % (queueSize-1 );
105+ _bottom_index = (_bottom_index +1 ) % (queueSize-1 );
106106 sem_post (&_available_thread);
107107 pthread_mutex_unlock (&mutexSync);
108108 return true ;
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ class ThreadPool{
6868 std::vector<WorkerThread *> _worker_queue;
6969
7070 int _top_index;
71- int bottomIndex ;
71+ int _bottom_index ;
7272
7373 int incompleteWork;
7474
You can’t perform that action at this time.
0 commit comments