class TestThread : de::Thread
{
public:
- TestThread (const vector<TestContext*> contexts);
+ TestThread (const vector<TestContext*> contexts, const Library& egl);
~TestThread (void);
void start (void);
private:
vector<TestContext*> m_contexts;
+ const Library& m_egl;
bool m_isOk;
string m_errorString;
TestThread (const TestThread&);
};
-TestThread::TestThread (const vector<TestContext*> contexts)
+TestThread::TestThread (const vector<TestContext*> contexts, const Library& egl)
: m_contexts (contexts)
+ , m_egl (egl)
, m_isOk (false)
, m_errorString ("")
, m_beginTimeUs (0)
m_isOk = false;
m_errorString = "Got unknown exception";
}
+
+ m_egl.releaseThread();
}
class SharedRenderingPerfCase : public TestCase
namespace
{
-void createThreads (vector<TestThread*>& threads, int threadCount, int perThreadContextCount, vector<TestContext*>& contexts)
+void createThreads (vector<TestThread*>& threads, int threadCount, int perThreadContextCount, vector<TestContext*>& contexts, const Library& egl)
{
DE_ASSERT(threadCount * perThreadContextCount == (int)contexts.size());
DE_ASSERT(threads.empty());
for (int contextNdx = 0; contextNdx < perThreadContextCount; contextNdx++)
threadContexts.push_back(contexts[threadNdx * perThreadContextCount + contextNdx]);
- threads.push_back(new TestThread(threadContexts));
+ threads.push_back(new TestThread(threadContexts, egl));
threadContexts.clear();
}
if (m_results.empty())
logTestConfig(m_testCtx.getLog(), m_config);
- createThreads(threads, m_config.threadCount, m_config.perThreadContextCount, m_contexts);
+ createThreads(threads, m_config.threadCount, m_config.perThreadContextCount, m_contexts, m_eglTestCtx.getLibrary());
beginTimeUs = deGetMicroseconds();