Check that threads started in multithreading tests
authorMark Adams <marka@nvidia.com>
Mon, 19 Jun 2017 15:19:16 +0000 (11:19 -0400)
committerMika Isojärvi <misojarvi@google.com>
Tue, 11 Jul 2017 17:41:38 +0000 (10:41 -0700)
The EGL GLES2 multithreading sharing tests could interpret a thread
that hadn't started yet as a finished thread.

Commit fd41d5d addressed the same issue but only changed one of the
two test iteration functions.

Author: Onni Kosomaa <okosomaa@nvidia.com>

Change-Id: Ie35390a8d57d9a0e8a679250a63ebb68e100de47

modules/egl/teglGLES2SharingThreadedTests.cpp

index 7e0ef88..a51a674 100644 (file)
@@ -3642,7 +3642,9 @@ tcu::TestCase::IterateResult GLES2ThreadedSharingTest::iterate (void)
                int readyThreads = 0;
                for (int threadNdx = 0; threadNdx < (int)m_threads.size(); threadNdx++)
                {
-                       if (m_threads[threadNdx]->getStatus() != tcu::ThreadUtil::Thread::THREADSTATUS_RUNNING)
+                       const tcu::ThreadUtil::Thread::ThreadStatus status = m_threads[threadNdx]->getStatus();
+
+                       if (status != tcu::ThreadUtil::Thread::THREADSTATUS_RUNNING && status != tcu::ThreadUtil::Thread::THREADSTATUS_NOT_STARTED)
                                readyThreads++;
                }