genericopenlibs/openenvcore/libpthread/test/testhybridthreads/src/thybridthreadsblocks.cpp
changeset 18 47c74d1534e1
parent 0 e4d67989cc36
child 45 4b03adbd26ca
child 57 2efc27d87e1c
--- a/genericopenlibs/openenvcore/libpthread/test/testhybridthreads/src/thybridthreadsblocks.cpp	Tue Feb 02 02:01:42 2010 +0200
+++ b/genericopenlibs/openenvcore/libpthread/test/testhybridthreads/src/thybridthreadsblocks.cpp	Fri Apr 16 16:46:38 2010 +0300
@@ -78,14 +78,18 @@
 	SetTestStepResult(EFail);
 	
 	RSemaphore bSem;
+	
+	void* rptr = 0;
 	ret = bSem.CreateGlobal(_L("HybridB"),0);
 	if(ret != KErrNone) 
 		{
 		ERR_PRINTF1(_L("Unable to create semaphore"));
-		goto close;
+		bSem.Close();
+		return TestStepResult();
 		}
 	
 	RSemaphore aSem;
+	RThread tmpThread;
 	ret = aSem.CreateGlobal(_L("HybridA"),0);
 	if(ret != KErrNone) 
 		{
@@ -100,7 +104,8 @@
 		goto close;
 		}
 
-	RThread tmpThread;
+
+	
 	ret = tmpThread.Create(_L("HybridThread"),reinterpret_cast<TThreadFunction>(threadAMethod),
 								0x5000,NULL,(void*)&threadB);
 	if(0 != ret)
@@ -116,7 +121,7 @@
 
 	INFO_PRINTF1(_L("Before pthread_join"));
 
-	void* rptr = 0;
+	
 	ret = pthread_join(threadB,&rptr);
 	if(0 != ret){
 		ERR_PRINTF2(_L("Error returned by pthread_join: %d"),ret);
@@ -169,6 +174,7 @@
    threadSpecific_data_t    *gData;
    gData = (threadSpecific_data_t *)parm;
    rc = pthread_setspecific(threadSpecificKey, gData);
+   rc = rc;
    foo();
    pthread_exit(0);
    return 0;
@@ -189,6 +195,7 @@
     {
     int rc;
     rc = pthread_setspecific(threadSpecificKey, NULL);
+    rc = rc;
     threadSpecific_data_t    *gData = (threadSpecific_data_t    *)data;
     free(gData);
     }