]> git.sesse.net Git - casparcg/blobdiff - common/executor.h
Move from boost::thread to std::thread for nearly everything.
[casparcg] / common / executor.h
index d6949615ac360c8b94671568a46eed750178f3db..9ec5c12311f97f0876fec34d02595de81654fcb5 100644 (file)
 #include <tbb/atomic.h>
 #include <tbb/concurrent_priority_queue.h>
 
-#include <boost/thread.hpp>
 #include <boost/optional.hpp>
 
 #include <functional>
 #include <future>
+#include <thread>
 
 namespace caspar {
 enum class task_priority
@@ -57,7 +57,7 @@ class executor final
 
        const std::wstring      name_;
        tbb::atomic<bool>       is_running_;
-       boost::thread           thread_;
+       std::thread             thread_;
        function_queue_t        execution_queue_;
        tbb::atomic<bool>       currently_in_task_;
 
@@ -75,7 +75,7 @@ public:
        {
                is_running_ = true;
                currently_in_task_ = false;
-               thread_ = boost::thread([this]{run();});
+               thread_ = std::thread([this]{run();});
        }
 
        ~executor()
@@ -178,7 +178,7 @@ public:
 
        bool is_current() const
        {
-               return boost::this_thread::get_id() == thread_.get_id();
+               return std::this_thread::get_id() == thread_.get_id();
        }
 
        bool is_currently_in_task() const