made small changes to resolve comparison of unsigned and regular ints
This commit is contained in:
		
							
								
								
									
										8
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								main.cpp
									
									
									
									
									
								
							| @@ -60,7 +60,7 @@ class thread_pool | ||||
| public: | ||||
|  | ||||
|     /* construction & destruction */ | ||||
|     explicit thread_pool(unsigned int); | ||||
|     explicit thread_pool(size_t); | ||||
|     ~thread_pool(); | ||||
|  | ||||
|     /* disallowed operations */ | ||||
| @@ -93,10 +93,10 @@ public: | ||||
|  | ||||
| }; | ||||
|  | ||||
| thread_pool::thread_pool(unsigned int thcount): | ||||
| thread_pool::thread_pool(size_t thcount): | ||||
|         fin(false) | ||||
| { | ||||
|     for (int i = 0; i < thcount ; ++i) | ||||
|     for (size_t i = 0; i < thcount ; ++i) | ||||
|         workers.emplace_back(&thread_pool::loop, this); | ||||
| } | ||||
|  | ||||
| @@ -174,7 +174,7 @@ void thread_pool::add_task(std::function<void()> func) | ||||
|  | ||||
| void thread_pool::add_thread(size_t num = 1) | ||||
| { | ||||
|     for (int i = 0; i < num; ++i) | ||||
|     for (size_t i = 0; i < num; ++i) | ||||
|     { | ||||
|         workers.emplace_back(&thread_pool::loop, this); | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user