]> git.sesse.net Git - casparcg/blobdiff - protocol/asio/io_service_manager.cpp
* Created custom decklink allocator for reducing memory footprint.
[casparcg] / protocol / asio / io_service_manager.cpp
index 3261c1816a301488797333aac203b273c9df22a6..0845d8fb4ad0b625e218b29a70b3e64a623c44a1 100644 (file)
@@ -28,6 +28,8 @@
 #include <boost/asio/io_service.hpp>
 #include <boost/thread/thread.hpp>
 
+#include <common/exception/win32_exception.h>
+
 namespace caspar { namespace protocol { namespace asio {
 
 struct io_service_manager::impl
@@ -40,10 +42,17 @@ struct io_service_manager::impl
 
        impl()
                : work_(new boost::asio::io_service::work(service_))
-               , thread_(std::bind(&boost::asio::io_service::run, &service_))
+               , thread_([this] { run(); })
        {
        }
 
+       void run()
+       {
+               win32_exception::ensure_handler_installed_for_thread("asio-thread");
+
+               service_.run();
+       }
+
        ~impl()
        {
                work_.reset();