#ifndef THREAD_UTILS_H_INCLUDED #define THREAD_UTILS_H_INCLUDED #include "boost/asio.hpp" #include "boost/signal.hpp" #include "boost/thread.hpp" namespace SE { namespace ST { extern boost::asio::io_service MainThreadIoService; extern boost::thread::id MainThreadId; } #ifndef UTILS_ENGINE struct TFuncToPerform { private: public: TFuncToPerform() : LockerPtr(new boost::mutex) { } std::shared_ptr LockerPtr; boost::function Func; }; void AssertIfInMainThread(); void TryUpdateMainThreadId(); void PerformInMainThreadAsync(boost::function f); void PerformInMainThreadAsyncLater(boost::function f); template RETURNTYPE PerformInMainThread(boost::function f); #endif } //namespace SE #endif