forked from 0ad/0ad
Fix tests and Atlas with new profiler
This was SVN commit r10471.
This commit is contained in:
parent
b13f1cade5
commit
8f3255f9c8
@ -781,7 +781,6 @@ void EarlyInit()
|
||||
|
||||
// initialise profiler early so it can profile startup
|
||||
g_Profiler2.Initialise();
|
||||
g_Profiler2.RegisterCurrentThread("main");
|
||||
|
||||
FixLocales();
|
||||
|
||||
|
@ -129,6 +129,8 @@ void CProfiler2::Initialise()
|
||||
int err = pthread_key_create(&m_TLS, &CProfiler2::TLSDtor);
|
||||
ENSURE(err == 0);
|
||||
m_Initialised = true;
|
||||
|
||||
RegisterCurrentThread("main");
|
||||
}
|
||||
|
||||
void CProfiler2::EnableHTTP()
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
#include "lib/timer.h"
|
||||
#include "lib/sysdep/sysdep.h"
|
||||
#include "ps/Profiler2.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
|
||||
class LeakReporter : public CxxTest::GlobalFixture
|
||||
@ -77,9 +78,17 @@ class MiscSetup : public CxxTest::GlobalFixture
|
||||
setlocale(LC_CTYPE, "UTF-8");
|
||||
#endif
|
||||
|
||||
g_Profiler2.Initialise();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool tearDownWorld()
|
||||
{
|
||||
g_Profiler2.Shutdown();
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
static LeakReporter leakReporter;
|
||||
|
@ -99,13 +99,15 @@ static void RendererIncrementalLoad()
|
||||
while (more && timer_Time() - startTime < maxTime);
|
||||
}
|
||||
|
||||
static void* RunEngine(void *data)
|
||||
static void* RunEngine(void* data)
|
||||
{
|
||||
debug_SetThreadName("engine_thread");
|
||||
|
||||
// Set new main thread so that all the thread-safety checks pass
|
||||
ThreadUtil::SetMainThread();
|
||||
|
||||
g_Profiler2.RegisterCurrentThread("atlasmain");
|
||||
|
||||
const CmdLineArgs args = *reinterpret_cast<const CmdLineArgs*>(data);
|
||||
|
||||
MessagePasserImpl* msgPasser = (MessagePasserImpl*)AtlasMessage::g_MessagePasser;
|
||||
|
Loading…
Reference in New Issue
Block a user