This commit is contained in:
1 parent
a8e01ed69d
commit
c9b7f21be5
11 files changed
+228
-13
No files matched your search
@@ -0,0 +1,26 @@
|
||||
#include "include/Engine.h"
|
||||
|
||||
namespace SE
|
||||
{
|
||||
|
||||
void AssertIfInMainThread()
|
||||
{
|
||||
if (boost::this_thread::get_id() != ResourceManager->MainThreadId)
|
||||
{
|
||||
throw ErrorToLog("ERROR! AssertIfInMainThread failed!");
|
||||
}
|
||||
}
|
||||
|
||||
void PerformInMainThreadAsync(boost::function<void()> f)
|
||||
{
|
||||
if (boost::this_thread::get_id() == ResourceManager->MainThreadId)
|
||||
{
|
||||
f();
|
||||
}
|
||||
else
|
||||
{
|
||||
ResourceManager->MainThreadAsyncFunctionArr.push_back(f);
|
||||
}
|
||||
}
|
||||
|
||||
} //namespace SE
|
||||
Reference in new issue
Block a user