use first thread for computations as well
authorGuillaume Seguin <guillaume@segu.in>
Fri, 14 Aug 2009 15:05:09 +0200
changeset 4753 0cfafd1e3541
parent 4752 d1fcd8777eac
child 4754 cda6688bca1d
use first thread for computations as well
src/simulator/multithreaded-simulator-impl.cc
--- a/src/simulator/multithreaded-simulator-impl.cc	Fri Aug 14 15:05:09 2009 +0200
+++ b/src/simulator/multithreaded-simulator-impl.cc	Fri Aug 14 15:05:09 2009 +0200
@@ -441,12 +441,13 @@
         }
     }
   /* Run threads */
-  for (uint32_t i = 0; i < m_threadsCount; i++)
+  for (uint32_t i = 1; i < m_threadsCount; i++)
     {
       pthread_create (&(m_threads[i].thread), NULL, &RunThread, &(m_threads[i]));
     }
+  DoRunThread (&(m_threads[0]));
   /* Join threads */
-  for (uint32_t i = 0; i < m_threadsCount; i++)
+  for (uint32_t i = 1; i < m_threadsCount; i++)
     {
       pthread_join (m_threads[i].thread, NULL);
     }