Browse Source

remove boost header

Laserlicht 7 months ago
parent
commit
38b537dcaf
2 changed files with 3 additions and 7 deletions
  1. 0 3
      Global.h
  2. 3 4
      lib/rmg/threadpool/ThreadPool.h

+ 0 - 3
Global.h

@@ -190,9 +190,6 @@ static_assert(sizeof(bool) == 1, "Bool needs to be 1 byte in size.");
 #include <boost/range/adaptor/reversed.hpp>
 #include <boost/range/algorithm.hpp>
 #include <boost/thread/thread_only.hpp>
-#include <boost/thread/shared_mutex.hpp>
-#include <boost/thread/recursive_mutex.hpp>
-#include <boost/thread/once.hpp>
 
 #ifndef M_PI
 #  define M_PI 3.14159265358979323846

+ 3 - 4
lib/rmg/threadpool/ThreadPool.h

@@ -27,7 +27,7 @@ private:
 	using Lock = std::unique_lock<std::shared_mutex>;
 	mutable std::shared_mutex mx;
 	mutable std::condition_variable_any cv;
-	mutable boost::once_flag once;
+	mutable std::once_flag once;
 
 	bool isInitialized = false;
 	bool stopping = false;
@@ -56,8 +56,7 @@ private:
 	mutable BlockingQueue<TRMGfunction> tasks;
 };
 
-ThreadPool::ThreadPool() :
-	once(BOOST_ONCE_INIT)
+ThreadPool::ThreadPool()
 {};
 
 ThreadPool::~ThreadPool()
@@ -67,7 +66,7 @@ ThreadPool::~ThreadPool()
 
 inline void ThreadPool::init(size_t numThreads)
 {
-	boost::call_once(once, [this, numThreads]()
+	std::call_once(once, [this, numThreads]()
 	{
 		Lock lock(mx);
 		stopping = false;