]> git.sesse.net Git - casparcg/blobdiff - shell/main.cpp
2.0. Initialize TBB worker threads right away to avoid spikes when playing the first...
[casparcg] / shell / main.cpp
index 7abdb28f1d8765e3235ad526dccd18577f9a5829..6843c9d225033b51802ccbc9b47d102461f6cd04 100644 (file)
 *    along with CasparCG.  If not, see <http://www.gnu.org/licenses/>.\r
 *\r
 */\r
-#include "resource.h"\r
-\r
-#include "server.h"\r
 \r
 // tbbmalloc_proxy: \r
 // Replace the standard memory allocation routines in Microsoft* C/C++ RTL \r
 // (malloc/free, global new/delete, etc.) with the TBB memory allocator. \r
 #include <tbb/tbbmalloc_proxy.h>\r
 \r
+#include "resource.h"\r
+\r
+#include "server.h"\r
+\r
 #ifdef _DEBUG\r
        #define _CRTDBG_MAP_ALLOC\r
        #include <stdlib.h>\r
@@ -58,6 +59,7 @@
 \r
 #include <core/mixer/gpu/ogl_device.h>\r
 \r
+#include <tbb/task_scheduler_init.h>\r
 #include <tbb/task_scheduler_observer.h>\r
 \r
 #include <boost/property_tree/detail/file_parser_error.hpp>\r
@@ -202,6 +204,8 @@ int main(int argc, wchar_t* argv[])
                        caspar::win32_exception::install_handler();\r
                }\r
        } tbb_thread_installer;\r
+\r
+       tbb::task_scheduler_init init;\r
        \r
        try \r
        {\r