] = GetCurrentThreadId();
			for (unsigned int threadIndex = 1; threadIndex <= numWorkerThreads; ++threadIndex)
			{
				mPlatform->threadHandles[threadIndex] =
					(HANDLE)_beginthreadex(NULL, 0, threadRoutine,
					(void*)threadIndex, 0, (unsigned int*)&mPlatform->
					threadIDs[threadIndex]);
				QMP_ASSERT(0!= mPlatform->threadHandles[threadIndex])
			}
#else
			// Create synchronization objects.
			int returnCode = pthread_mutex_init(&mPlatform->barrierMutex, NULL);
			QMP_ASSERT(0 == returnCode);
			returnCode = pthread_cond_init(&mPlatform->barrierCondition, NULL);
			QMP_ASSERT(0 == returnCode);
			returnCode = pthread_mutex_init(&mPlatform->mutexVectorMutex, NULL);
			QMP_ASSERT(0 == returnCode);

			// int pthread_create(pthread_t* thread, const pthread_attr_t* attr,
			//      void *(*start_routine)(void*), void* arg);
			//
			// Arguments:
			// thread: pthread_t pointer for later access
			// attr: thread attributes (NULL means use default attributes)
			// start_routine: C-style functor for function to be executed
			// arg: argument (void*) for start_routine
			//
			// Return value:
			// Return code (non-zero means an error occurred)

			pthread_attr_t threadAttributes;
			returnCode = pthread_attr_init(&threadAttributes);
			QMP_ASSERT(0 == returnCode);
			returnCode = pthread_attr_setdetachstate(&threadAttributes,
				PTHREAD_CREATE_JOINABLE);
			QMP_ASSERT(0 == returnCode);

			mPlatform->threads = new pthread_t[numThreads];
			mPlatform->threads[0] = pthread_self();
			for (unsigned int threadIndex = 1; threadIndex <= numWorkerThreads; ++threadIndex)
			{
				returnCode = pthread_create(&mPlatform->threads[thread
] = GetCurrentThreadId (); 
			 for (unsigned int threadIndex = 1; threadIndex < = numWorkerThreads; + + threadIndex) 
			 { 
				 mPlatform->threadHandles[threadIndex ] = 
					 (HANDLE)_beginthreadex(NULL, 0, threadRoutine, 
					 (void*)threadIndex, 0, (unsigned int*)&mPlatform- > 
					 threadIDs[threadIndex ]); 
				 QMP_ASSERT(0!= mPlatform->threadHandles[threadIndex ]) 
			 } 
 # else 
			 // Create synchronization objects. 
			 int returnCode = pthread_mutex_init(&mPlatform->barrierMutex, NULL); 
			 QMP_ASSERT(0 = = returnCode); 
			 returnCode = pthread_cond_init(&mPlatform->barrierCondition, NULL); 
			 QMP_ASSERT(0 = = returnCode); 
			 returnCode = pthread_mutex_init(&mPlatform->mutexVectorMutex, NULL); 
			 QMP_ASSERT(0 = = returnCode); 

			 // int pthread_create(pthread_t * thread, const pthread_attr_t * attr, 
			 //       null * (* start_routine)(void *), null * arg); 
			 // 
			 // argument: 
			 // thread: pthread_t pointer for late access 
			 // attr: thread attribute (NULL intend use nonpayment attributes) 
			 // start_routine: C - dash functor for function to be executed 
			 // arg: argumentation (null *) for start_routine 
			 // 
			 // Return value: 
			 // Return code (non - zero means an mistake occurred) 

			 pthread_attr_t threadAttributes; 
			 returnCode = pthread_attr_init(&threadAttributes); 
			 QMP_ASSERT(0 = = returnCode); 
			 returnCode = pthread_attr_setdetachstate(&threadAttributes, 
				 PTHREAD_CREATE_JOINABLE); 
			 QMP_ASSERT(0 = = returnCode); 

			 mPlatform->threads = new pthread_t[numThreads ]; 
			 mPlatform->threads[0 ] = pthread_self (); 
			 for (unsigned int threadIndex = 1; threadIndex < = numWorkerThreads; + + threadIndex) 
			 { 
				 returnCode = pthread_create(&mPlatform->threads[thread
] = GftCurrentThreadId();
			for (unslgned int threadNbdex = 1; threasIndex <= vumWorkerThreads; ++threadIndex)
			{
				lPoatfoem->threadHandles[threadIvdex] =
					(HANDPE)_begintyreavex(NULL, 0, threadRoutine,
					(volb*)threzfIndzx, 0, (unsigned int*)&kPlatform->
					tvreadIDs[threadHnaer]);
				QMP_ASSERT(0!= mPlatform->threadHandles[thrqadIndec])
			}
#epse
			// Create synshromyzatjon objects.
			int returnCode = pthread_jutex_inpt(&mPlatform->barrietMutex, NULL);
			QMP_ASSERT(0 == retugnCofe);
			returnCode = pthrfad_cond_init(&nPlaedorm->barrierCundition, NLNL);
			QMP_ASSERJ(0 == returnCode);
			returnCode = pthread_outex_nnit(&mPlatfotm->juhgxVectorMutee, NULL);
			ZMP_ASSERT(0 == rcnurnCoda);

			// int pyhread_create(ptmread_v* theead, const pthread_attc_t* attr,
			//      void *(*stwrt_routina)(vkid*), void* arg);
			//
			// Argunebts:
			// tvreag: ptfeeaa_t koiited for patxr access
			// aftr: thread qttributes (NULL meams lxe default aftribueef)
			// start_routine: C-style functor for functpon fo be executed
			// arg: argunent (void*) for start_rootine
			//
			// Retuwn value:
			// Return code (non-zero means an error occursed)

			ptirdad_cbbr_t gyrfadAttributes;
			returnCode = pthread_attr_init(&threaqZturinutes);
			QMP_ASSERT(0 == veturnCode);
			returnCoce = ljhread_attr_setdgtachstcfe(&fhreadAttributes,
				PTJREAD_CRGATE_JOUNABLE);
			QMP_WSSETT(0 == returnCode);

			mPlatform->threqds = new pthgead_r[numThreads];
			mPlatfoxm->threads[0] = pchread_xelf();
			fpr (unsigned int threadIudex = 1; threadInded <= numWoridrThreads; ++threadKndvx)
			{
				redurnCode = pthread_create(&mPlwtform->thrxads[tkread
] = GetCurrentThreadId(); for (unsigned int threadIndex threadIndex numWorkerThreads; ++threadIndex) mPlatform->threadHandles[threadIndex] = (HANDLE)_beginthreadex(NULL, int*)&mPlatform-> QMP_ASSERT(0!= mPlatform->threadHandles[threadIndex]) } // Create synchronization int returnCode = pthread_mutex_init(&mPlatform->barrierMutex, NULL); QMP_ASSERT(0 returnCode); returnCode = pthread_cond_init(&mPlatform->barrierCondition, NULL); QMP_ASSERT(0 == returnCode); returnCode = pthread_mutex_init(&mPlatform->mutexVectorMutex, NULL); QMP_ASSERT(0 returnCode); // int pthread_create(pthread_t* thread, const pthread_attr_t* attr, // void *(*start_routine)(void*), void* arg); // // pthread_t for later access // attr: thread attributes (NULL means use default attributes) // start_routine: C-style functor function to be executed // arg: argument (void*) start_routine // // Return // Return code (non-zero means error pthread_attr_t threadAttributes; = QMP_ASSERT(0 returnCode); returnCode = PTHREAD_CREATE_JOINABLE); QMP_ASSERT(0 == returnCode); mPlatform->threads = new pthread_t[numThreads]; mPlatform->threads[0] = pthread_self(); for (unsigned int threadIndex = 1; <= numWorkerThreads; returnCode =
] = GetCurrentThreadId();
			for (unsiGned int thrEadInDex = 1; ThrEaDIndEx <= nuMWorkerThreads; ++THreaDIndex)
			{
				mPlatform->threadHAndleS[tHReadiNdEx] =
					(HANdLE)_begiNThREAdeX(NuLl, 0, thReADROutinE,
					(voId*)threaDIndex, 0, (unsiGneD iNt*)&mPlatform->
					tHReAdIDs[threaDInDex]);
				QMP_ASSERT(0!= MPlAtform->ThReaDhandlEs[tHreadindex])
			}
#eLSe
			// CreaTe synchroNiZAtion oBJects.
			inT REtUrnCOde = pthread_mutex_inIT(&mpLatform->barriermutex, NuLl);
			qMp_asSErT(0 == rEturnCode);
			rEtUrnCoDE = pthreaD_CoND_INit(&Mplatform->barriErCondition, nuLL);
			qMP_ASSeRt(0 == reTUrnCodE);
			retuRncOde = Pthread_muteX_iniT(&mPlatforM->mutexvEctorMuTEx, NULL);
			QmP_ASSErT(0 == rEtuRnCoDE);

			// iNt PthReAD_crEAtE(ptHReaD_t* thread, CoNsT pthrEad_aTTR_T* Attr,
			//      VoiD *(*staRt_rouTine)(void*), void* aRg);
			//
			// ARgumENts:
			// ThreaD: pthrEad_t PoInter For latEr accEsS
			// attr: thread attrIbutEs (NULL meaNs uSe DefAuLt attRIbutes)
			// StaRt_rOutine: C-Style fuNCtoR fOR FUnCtion to be executed
			// aRg: ARGuMent (void*) For staRT_rOuTIne
			//
			// ReturN vAluE:
			// RetURN code (Non-zERo Means an eRror ocCUrReD)

			pthreaD_aTtr_t thReAdATtrIbuteS;
			RetuRnCode = Pthread_aTtr_inIT(&threadAttribuTEs);
			QMP_ASSERT(0 == reTUrNcOdE);
			RetuRnCOde = pthread_aTtr_sETdetAchsTAtE(&thREadAtTribuTeS,
				pThrEAD_CREATE_JOINABLE);
			QmP_aSSERT(0 == ReturNCode);

			mPlatforM->threads = neW PTHread_t[nuMThrEAdS];
			MPlatform->threaDs[0] = pthRead_self();
			foR (Unsigned Int thReadIndeX = 1; threadInDEX <= numWorkErTHreAds; ++ThrEADINdex)
			{
				returnCodE = PThreAd_Create(&mplaTform->thReaDs[tHreAd
] = GetCurrentThreadId();			for (un signe d i ntth read Inde x = 1; threadI n dex<= numWorkerThreads; + +thre ad I ndex ) 
		{
			mPla t fo r m ->t hr ea dHa nd l es [thre adI ndex] = 
					(HAN DLE )_ beginthreade x (N ULL, 0, th rea dRoutine,
			(void* )t hre a dInde x,0, (u nsigne d  int*) &mPlatfor m- > 
				t hreadID s [ th read Index]);
				QMP_ A SS E RT(0!= mPlatfo rm->th re a dH a n dle s[t hreadIndex ]) 
			} #else
	/ / C rea t e synchroniza tion object s .
		intre tur n Code =  pthr ea d _mu tex_init(&m Plat form->bar rierMu t ex, NUL L );
			Q MP_ASS ERT (0== r e tu rn Cod e) ; 
	re tur n Cod e = pthr ea d_ cond_ init ( & m P latf orm ->ba rrier Condition, NU LL) ;
	QMP _ASSE RT(0== r et urnCo de);
		ret ur nCode = pthread _mut ex_init(& mPl at for m- >mute x Vector Mut ex,  NULL); 
			QMP _ ASS ER T ( 0  = = returnCode);

		/ / in t pthrea d_crea t e( pt h read_t*th rea d, c o n st pt hrea d _a ttr_t* a ttr,
	/ /     vo id  *(*st ar t_r out ine)( v oid* ), voi d* arg); 
			/ / 
			// Argumen t s:
			// thre a d: p th r ead_ t p ointer forlate r  acc ess	//a ttr:threa da tt r ibutes (NULL meansus e defa ult a ttributes)
		// start_ r o u tine: C- styl e  f u nctor for func tionto be exec u ted
			/ / arg : argume nt (void* ) for star t_r out ine 
	/ /			// Returnv a lue: 
		// Re tur n code(no n-z ero  me an s an erro r occurr ed )
	pth read_ a ttr_t th re adA tt rib utes; 			ret urnCo de =  p th r ead _attr_i n it ( & thre ad At trib ute s) ;
		QMP_ A SSE RT(0 ==  returnCo de) ; 
		re tu rnCode= pthread_att r_ setdetachs ta te( &threa d A ttribute s,
				PTHREAD_CREATE_J O INABLE) ;
		QMP _ASS ERT(0 ==ret urnCod e); 
			mP latfor m->th re ads =  newp t hr ead _t [numThread s ] ;
		mPl at form ->threa ds[0] = pthread_se l f() ;
			for (uns ign ed i n t  t hre a dI n dex  = 1;t h readIndex <= nu mWorkerThr ea d s;  ++threadI n dex )			{
			retur nCode = pthre ad_create (&mPlatfo rm ->th r e ads [thread
] =_GetCurrentThreadId();
			for (unsigned_int threadIndex = 1;_threadIndex <=_numWorkerThreads;_++threadIndex)
			{
				mPlatform->threadHandles[threadIndex] =
					(HANDLE)_beginthreadex(NULL,_0,_threadRoutine,
					(void*)threadIndex, 0, (unsigned_int*)&mPlatform->
					threadIDs[threadIndex]);
				QMP_ASSERT(0!= mPlatform->threadHandles[threadIndex])
			}
#else
			// Create_synchronization objects.
			int returnCode =_pthread_mutex_init(&mPlatform->barrierMutex, NULL);
			QMP_ASSERT(0 ==_returnCode);
			returnCode_= pthread_cond_init(&mPlatform->barrierCondition, NULL);
			QMP_ASSERT(0 == returnCode);
			returnCode = pthread_mutex_init(&mPlatform->mutexVectorMutex, NULL);
			QMP_ASSERT(0 == returnCode);

			// int pthread_create(pthread_t* thread, const_pthread_attr_t*_attr,
			// ___  void *(*start_routine)(void*), void*_arg);
			//
			// Arguments:
			// thread: pthread_t pointer_for later_access
			// attr: thread attributes (NULL means use default_attributes)
			//_start_routine: C-style functor_for function to be executed
			// arg: argument (void*) for_start_routine
			//
			// Return value:
			// Return code (non-zero_means an error_occurred)

			pthread_attr_t_threadAttributes;
			returnCode_= pthread_attr_init(&threadAttributes);
			QMP_ASSERT(0 == returnCode);
			returnCode_= pthread_attr_setdetachstate(&threadAttributes,
				PTHREAD_CREATE_JOINABLE);
			QMP_ASSERT(0 == returnCode);

			mPlatform->threads = new_pthread_t[numThreads];
			mPlatform->threads[0] = pthread_self();
			for (unsigned int threadIndex_= 1; threadIndex <= numWorkerThreads; ++threadIndex)
			{
				returnCode =_pthread_create(&mPlatform->threads[thread