All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH]pthread_join:4-1.c: clean up code
@ 2012-03-28  6:10 lidan
  2012-03-28  6:17 ` Caspar Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: lidan @ 2012-03-28  6:10 UTC (permalink / raw)
  To: ltp-list

code cleanup for pthread_join/4-1.c


Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
---
 .../conformance/interfaces/pthread_join/4-1.c      |  134 +++++++++-----------
 1 files changed, 58 insertions(+), 76 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
index baf0992..7ee4870 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
@@ -16,7 +16,8 @@
 
 * This sample test aims to check the following assertion:
 *
-* If the thread calling pthread_join is canceled, the joined thread remains joinable.
+* If the thread calling pthread_join is canceled, the joined thread
+* remains joinable.
 
 * The steps are:
 * -> create a thread blocked on a mutex.
@@ -31,9 +32,9 @@
 /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
 #define _POSIX_C_SOURCE 200112L
 
-/********************************************************************************************/
-/****************************** standard includes *****************************************/
-/********************************************************************************************/
+/**************************************************************/
+/********************** standard includes *********************/
+/**************************************************************/
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -44,14 +45,15 @@
 
 #include <errno.h>
 
-/********************************************************************************************/
-/******************************   Test framework   *****************************************/
-/********************************************************************************************/
+/***************************************************************/
+/*********************   Test framework   **********************/
+/***************************************************************/
 #include "../testfrmw/testfrmw.h"
 #include "../testfrmw/testfrmw.c"
 /* This header is responsible for defining the following macros:
  * UNRESOLVED(ret, descr);
- *    where descr is a description of the error and ret is an int (error code for example)
+ *    where descr is a description of the error and ret is an int
+ *    (error code for example)
  * FAILED(descr);
  *    where descr is a short text saying why the test has failed.
  * PASSED();
@@ -67,16 +69,16 @@
  * Those may be used to output information.
  */
 
-/********************************************************************************************/
-/********************************** Configuration ******************************************/
-/********************************************************************************************/
+/***************************************************************/
+/************************ Configuration ************************/
+/***************************************************************/
 #ifndef VERBOSE
 #define VERBOSE 1
 #endif
 
-/********************************************************************************************/
-/***********************************     Helper     *****************************************/
-/********************************************************************************************/
+/***************************************************************/
+/***********************     Helper     ************************/
+/***************************************************************/
 #include "../testfrmw/threads_scenarii.c"
 /* this file defines:
 * scenarii: array of struct __scenario type.
@@ -85,14 +87,14 @@
 * scenar_fini(): function to call after end of use of the scenarii array.
 */
 
-/********************************************************************************************/
-/***********************************    Test case   *****************************************/
-/********************************************************************************************/
+/***************************************************************/
+/***********************    Test case   ************************/
+/***************************************************************/
 
 pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
 
 /* 1st thread function */
-void * threaded (void * arg)
+void *threaded(void *arg)
 {
 	int ret = 0;
 
@@ -101,22 +103,18 @@ void * threaded (void * arg)
 	ret = pthread_mutex_lock(&mtx);
 
 	if (ret != 0)
-	{
 		UNRESOLVED(ret, "Failed to lock mutex");
-	}
 
 	ret = pthread_mutex_unlock(&mtx);
 
 	if (ret != 0)
-	{
 		UNRESOLVED(ret, "Failed to unlock mutex");
-	}
 
 	return NULL;
 }
 
 /* Canceled thread */
-void * joiner_func(void * arg)
+void *joiner_func(void *arg)
 {
 	(void) pthread_join(*(pthread_t *) arg, NULL);
 
@@ -139,70 +137,64 @@ int main(int argc, char *argv[])
 	/* Initialize thread attribute objects */
 	scenar_init();
 
-	for (sc = 0; sc < NSCENAR; sc++)
-	{
+	for (sc = 0; sc < NSCENAR; sc++) {
 #if VERBOSE > 0
 		output("-----\n");
-		output("Starting test with scenario (%i): %s\n", sc, scenarii[ sc ].descr);
+		output("Starting test with scenario (%i): %s\n",
+					sc, scenarii[sc].descr);
 #endif
 
 		/* Lock the mutex */
 		ret = pthread_mutex_lock(&mtx);
 
 		if (ret != 0)
-		{
 			UNRESOLVED(ret, "failed to lock the mutex");
-		}
-
-		ret = pthread_create(&child, &scenarii[ sc ].ta, threaded, NULL);
 
-		switch (scenarii[ sc ].result)
-		{
-				case 0:                                       /* Operation was expected to succeed */
+		ret = pthread_create(&child, &scenarii[sc].ta, threaded,
+									NULL);
 
-				if (ret != 0)
-				{
-					UNRESOLVED(ret, "Failed to create this thread");
-				}
+		switch (scenarii[sc].result) {
+		/* Operation was expected to succeed */
+		case 0:
 
-				break;
-
-				case 1:                                       /* Operation was expected to fail */
+			if (ret != 0)
+				UNRESOLVED(ret, "Failed to create this thread");
 
-				if (ret == 0)
-				{
-					UNRESOLVED(-1, "An error was expected but the thread creation succeeded");
-				}
+			break;
+		/* Operation was expected to fail */
+		case 1:
 
-				break;
+			if (ret == 0)
+				UNRESOLVED(-1, "An error was expected \
+					but the thread creation succeeded");
 
-				case 2:                                       /* We did not know the expected result */
-				default:
+			break;
+		/* We did not know the expected result */
+		case 2:
+		default:
 #if VERBOSE > 0
 
-				if (ret == 0)
-				{
-					output("Thread has been created successfully for this scenario\n");
-				}
-				else
-				{
-					output("Thread creation failed with the error: %s\n", strerror(ret));
-				}
+			if (ret == 0) {
+				output("Thread has been created \
+					successfully for this scenario\n");
+			} else {
+				output("Thread creation failed with the error:\
+							%s\n", strerror(ret));
+			}
 
 #endif
 
 		}
-
-		if (ret == 0)                                       /* The new thread is running */
-		{
+		/* The new thread is running */
+		if (ret == 0) {
 
 			/* Now create the joiner thread */
-			ret = pthread_create(&joiner, NULL, joiner_func, &child);
+			ret = pthread_create(&joiner, NULL, joiner_func,
+								&child);
 
 			if (ret != 0)
-			{
-				UNRESOLVED(ret, "Failed to create the joiner thread");
-			}
+				UNRESOLVED(ret, "Failed to create the \
+								joiner thread");
 
 			/* Let it enter pthread_join */
 			sched_yield();
@@ -211,44 +203,34 @@ int main(int argc, char *argv[])
 			ret = pthread_cancel(joiner);
 
 			if (ret != 0)
-			{
 				UNRESOLVED(ret, "Failed to cancel the thread");
-			}
 
 			/* Join the canceled thread */
 			ret = pthread_join(joiner, NULL);
 
 			if (ret != 0)
-			{
-				UNRESOLVED(ret, "Failed to join the canceled thread");
-			}
+				UNRESOLVED(ret, "Failed to join \
+							the canceled thread");
 
 			/* Unblock the child thread */
 			ret = pthread_mutex_unlock(&mtx);
 
 			if (ret != 0)
-			{
 				UNRESOLVED(ret, "Failed to unlock the mutex");
-			}
 
 			/* Check the first thread is still joinable */
 			ret = pthread_join(child, NULL);
 
-			if (ret != 0)
-			{
+			if (ret != 0) {
 				output("Error returned: %d\n");
 				FAILED("The thread is no more joinable");
 			}
 
-		}
-		else
-		{
+		} else {
 			ret = pthread_mutex_unlock(&mtx);
 
 			if (ret != 0)
-			{
 				UNRESOLVED(ret, "Failed to unlock the mutex");
-			}
 		}
 	}
 
-- 
1.7.7.2


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH]pthread_join:4-1.c: clean up code
  2012-03-28  6:10 [LTP] [PATCH]pthread_join:4-1.c: clean up code lidan
@ 2012-03-28  6:17 ` Caspar Zhang
  2012-03-28  6:44   ` Wanlong Gao
  2012-03-28  7:31   ` [LTP] [PATCHv2]pthread_join:4-1.c: " lidan
  0 siblings, 2 replies; 7+ messages in thread
From: Caspar Zhang @ 2012-03-28  6:17 UTC (permalink / raw)
  To: ltp-list

On 03/28/2012 02:10 PM, lidan wrote:
> code cleanup for pthread_join/4-1.c
> 
> 
> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>

After applied the package, I use -f option with checkpatch.pl, it still
shows some warnings:

$ ckp -f 4-1.c
WARNING: Avoid line continuations in quoted strings
#168: FILE: 4-1.c:168:
+				UNRESOLVED(-1, "An error was expected \

WARNING: Avoid line continuations in quoted strings
#178: FILE: 4-1.c:178:
+				output("Thread has been created \

WARNING: Avoid line continuations in quoted strings
#181: FILE: 4-1.c:181:
+				output("Thread creation failed with the error:\

WARNING: Avoid line continuations in quoted strings
#196: FILE: 4-1.c:196:
+				UNRESOLVED(ret, "Failed to create the \

WARNING: Avoid line continuations in quoted strings
#212: FILE: 4-1.c:212:
+				UNRESOLVED(ret, "Failed to join \

total: 0 errors, 5 warnings, 245 lines checked

4-1.c has style problems, please review.

If any of these errors are false positives, please report
them to the maintainer, see CHECKPATCH in MAINTAINERS.

I'd suggest you do the same when you make code cleanup patches.

Thanks,
Caspar

> ---
>  .../conformance/interfaces/pthread_join/4-1.c      |  134 +++++++++-----------
>  1 files changed, 58 insertions(+), 76 deletions(-)
> 
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> index baf0992..7ee4870 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> @@ -16,7 +16,8 @@
>  
>  * This sample test aims to check the following assertion:
>  *
> -* If the thread calling pthread_join is canceled, the joined thread remains joinable.
> +* If the thread calling pthread_join is canceled, the joined thread
> +* remains joinable.
>  
>  * The steps are:
>  * -> create a thread blocked on a mutex.
> @@ -31,9 +32,9 @@
>  /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
>  #define _POSIX_C_SOURCE 200112L
>  
> -/********************************************************************************************/
> -/****************************** standard includes *****************************************/
> -/********************************************************************************************/
> +/**************************************************************/
> +/********************** standard includes *********************/
> +/**************************************************************/
>  #include <pthread.h>
>  #include <stdarg.h>
>  #include <stdio.h>
> @@ -44,14 +45,15 @@
>  
>  #include <errno.h>
>  
> -/********************************************************************************************/
> -/******************************   Test framework   *****************************************/
> -/********************************************************************************************/
> +/***************************************************************/
> +/*********************   Test framework   **********************/
> +/***************************************************************/
>  #include "../testfrmw/testfrmw.h"
>  #include "../testfrmw/testfrmw.c"
>  /* This header is responsible for defining the following macros:
>   * UNRESOLVED(ret, descr);
> - *    where descr is a description of the error and ret is an int (error code for example)
> + *    where descr is a description of the error and ret is an int
> + *    (error code for example)
>   * FAILED(descr);
>   *    where descr is a short text saying why the test has failed.
>   * PASSED();
> @@ -67,16 +69,16 @@
>   * Those may be used to output information.
>   */
>  
> -/********************************************************************************************/
> -/********************************** Configuration ******************************************/
> -/********************************************************************************************/
> +/***************************************************************/
> +/************************ Configuration ************************/
> +/***************************************************************/
>  #ifndef VERBOSE
>  #define VERBOSE 1
>  #endif
>  
> -/********************************************************************************************/
> -/***********************************     Helper     *****************************************/
> -/********************************************************************************************/
> +/***************************************************************/
> +/***********************     Helper     ************************/
> +/***************************************************************/
>  #include "../testfrmw/threads_scenarii.c"
>  /* this file defines:
>  * scenarii: array of struct __scenario type.
> @@ -85,14 +87,14 @@
>  * scenar_fini(): function to call after end of use of the scenarii array.
>  */
>  
> -/********************************************************************************************/
> -/***********************************    Test case   *****************************************/
> -/********************************************************************************************/
> +/***************************************************************/
> +/***********************    Test case   ************************/
> +/***************************************************************/
>  
>  pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
>  
>  /* 1st thread function */
> -void * threaded (void * arg)
> +void *threaded(void *arg)
>  {
>  	int ret = 0;
>  
> @@ -101,22 +103,18 @@ void * threaded (void * arg)
>  	ret = pthread_mutex_lock(&mtx);
>  
>  	if (ret != 0)
> -	{
>  		UNRESOLVED(ret, "Failed to lock mutex");
> -	}
>  
>  	ret = pthread_mutex_unlock(&mtx);
>  
>  	if (ret != 0)
> -	{
>  		UNRESOLVED(ret, "Failed to unlock mutex");
> -	}
>  
>  	return NULL;
>  }
>  
>  /* Canceled thread */
> -void * joiner_func(void * arg)
> +void *joiner_func(void *arg)
>  {
>  	(void) pthread_join(*(pthread_t *) arg, NULL);
>  
> @@ -139,70 +137,64 @@ int main(int argc, char *argv[])
>  	/* Initialize thread attribute objects */
>  	scenar_init();
>  
> -	for (sc = 0; sc < NSCENAR; sc++)
> -	{
> +	for (sc = 0; sc < NSCENAR; sc++) {
>  #if VERBOSE > 0
>  		output("-----\n");
> -		output("Starting test with scenario (%i): %s\n", sc, scenarii[ sc ].descr);
> +		output("Starting test with scenario (%i): %s\n",
> +					sc, scenarii[sc].descr);
>  #endif
>  
>  		/* Lock the mutex */
>  		ret = pthread_mutex_lock(&mtx);
>  
>  		if (ret != 0)
> -		{
>  			UNRESOLVED(ret, "failed to lock the mutex");
> -		}
> -
> -		ret = pthread_create(&child, &scenarii[ sc ].ta, threaded, NULL);
>  
> -		switch (scenarii[ sc ].result)
> -		{
> -				case 0:                                       /* Operation was expected to succeed */
> +		ret = pthread_create(&child, &scenarii[sc].ta, threaded,
> +									NULL);
>  
> -				if (ret != 0)
> -				{
> -					UNRESOLVED(ret, "Failed to create this thread");
> -				}
> +		switch (scenarii[sc].result) {
> +		/* Operation was expected to succeed */
> +		case 0:
>  
> -				break;
> -
> -				case 1:                                       /* Operation was expected to fail */
> +			if (ret != 0)
> +				UNRESOLVED(ret, "Failed to create this thread");
>  
> -				if (ret == 0)
> -				{
> -					UNRESOLVED(-1, "An error was expected but the thread creation succeeded");
> -				}
> +			break;
> +		/* Operation was expected to fail */
> +		case 1:
>  
> -				break;
> +			if (ret == 0)
> +				UNRESOLVED(-1, "An error was expected \
> +					but the thread creation succeeded");
>  
> -				case 2:                                       /* We did not know the expected result */
> -				default:
> +			break;
> +		/* We did not know the expected result */
> +		case 2:
> +		default:
>  #if VERBOSE > 0
>  
> -				if (ret == 0)
> -				{
> -					output("Thread has been created successfully for this scenario\n");
> -				}
> -				else
> -				{
> -					output("Thread creation failed with the error: %s\n", strerror(ret));
> -				}
> +			if (ret == 0) {
> +				output("Thread has been created \
> +					successfully for this scenario\n");
> +			} else {
> +				output("Thread creation failed with the error:\
> +							%s\n", strerror(ret));
> +			}
>  
>  #endif
>  
>  		}
> -
> -		if (ret == 0)                                       /* The new thread is running */
> -		{
> +		/* The new thread is running */
> +		if (ret == 0) {
>  
>  			/* Now create the joiner thread */
> -			ret = pthread_create(&joiner, NULL, joiner_func, &child);
> +			ret = pthread_create(&joiner, NULL, joiner_func,
> +								&child);
>  
>  			if (ret != 0)
> -			{
> -				UNRESOLVED(ret, "Failed to create the joiner thread");
> -			}
> +				UNRESOLVED(ret, "Failed to create the \
> +								joiner thread");
>  
>  			/* Let it enter pthread_join */
>  			sched_yield();
> @@ -211,44 +203,34 @@ int main(int argc, char *argv[])
>  			ret = pthread_cancel(joiner);
>  
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to cancel the thread");
> -			}
>  
>  			/* Join the canceled thread */
>  			ret = pthread_join(joiner, NULL);
>  
>  			if (ret != 0)
> -			{
> -				UNRESOLVED(ret, "Failed to join the canceled thread");
> -			}
> +				UNRESOLVED(ret, "Failed to join \
> +							the canceled thread");
>  
>  			/* Unblock the child thread */
>  			ret = pthread_mutex_unlock(&mtx);
>  
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to unlock the mutex");
> -			}
>  
>  			/* Check the first thread is still joinable */
>  			ret = pthread_join(child, NULL);
>  
> -			if (ret != 0)
> -			{
> +			if (ret != 0) {
>  				output("Error returned: %d\n");
>  				FAILED("The thread is no more joinable");
>  			}
>  
> -		}
> -		else
> -		{
> +		} else {
>  			ret = pthread_mutex_unlock(&mtx);
>  
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to unlock the mutex");
> -			}
>  		}
>  	}
>  


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCH]pthread_join:4-1.c: clean up code
  2012-03-28  6:17 ` Caspar Zhang
@ 2012-03-28  6:44   ` Wanlong Gao
  2012-03-28  7:31   ` [LTP] [PATCHv2]pthread_join:4-1.c: " lidan
  1 sibling, 0 replies; 7+ messages in thread
From: Wanlong Gao @ 2012-03-28  6:44 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: ltp-list

On 03/28/2012 02:17 PM, Caspar Zhang wrote:

> On 03/28/2012 02:10 PM, lidan wrote:
>> code cleanup for pthread_join/4-1.c
>>
>>
>> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> 
> After applied the package, I use -f option with checkpatch.pl, it still
> shows some warnings:
> 
> $ ckp -f 4-1.c
> WARNING: Avoid line continuations in quoted strings
> #168: FILE: 4-1.c:168:
> +				UNRESOLVED(-1, "An error was expected \
> 
> WARNING: Avoid line continuations in quoted strings
> #178: FILE: 4-1.c:178:
> +				output("Thread has been created \
> 
> WARNING: Avoid line continuations in quoted strings
> #181: FILE: 4-1.c:181:
> +				output("Thread creation failed with the error:\
> 
> WARNING: Avoid line continuations in quoted strings
> #196: FILE: 4-1.c:196:
> +				UNRESOLVED(ret, "Failed to create the \
> 
> WARNING: Avoid line continuations in quoted strings
> #212: FILE: 4-1.c:212:
> +				UNRESOLVED(ret, "Failed to join \
> 
> total: 0 errors, 5 warnings, 245 lines checked
> 
> 4-1.c has style problems, please review.
> 
> If any of these errors are false positives, please report
> them to the maintainer, see CHECKPATCH in MAINTAINERS.
> 
> I'd suggest you do the same when you make code cleanup patches.


yes, to avoid line continuations is the right thing.

Li, please fix as the warnings.

Thanks,
Wanlong Gao

> 
> Thanks,
> Caspar
> 
>> ---
>>  .../conformance/interfaces/pthread_join/4-1.c      |  134 +++++++++-----------
>>  1 files changed, 58 insertions(+), 76 deletions(-)
>>
>> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
>> index baf0992..7ee4870 100644
>> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
>> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
>> @@ -16,7 +16,8 @@
>>  
>>  * This sample test aims to check the following assertion:
>>  *
>> -* If the thread calling pthread_join is canceled, the joined thread remains joinable.
>> +* If the thread calling pthread_join is canceled, the joined thread
>> +* remains joinable.
>>  
>>  * The steps are:
>>  * -> create a thread blocked on a mutex.
>> @@ -31,9 +32,9 @@
>>  /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
>>  #define _POSIX_C_SOURCE 200112L
>>  
>> -/********************************************************************************************/
>> -/****************************** standard includes *****************************************/
>> -/********************************************************************************************/
>> +/**************************************************************/
>> +/********************** standard includes *********************/
>> +/**************************************************************/
>>  #include <pthread.h>
>>  #include <stdarg.h>
>>  #include <stdio.h>
>> @@ -44,14 +45,15 @@
>>  
>>  #include <errno.h>
>>  
>> -/********************************************************************************************/
>> -/******************************   Test framework   *****************************************/
>> -/********************************************************************************************/
>> +/***************************************************************/
>> +/*********************   Test framework   **********************/
>> +/***************************************************************/
>>  #include "../testfrmw/testfrmw.h"
>>  #include "../testfrmw/testfrmw.c"
>>  /* This header is responsible for defining the following macros:
>>   * UNRESOLVED(ret, descr);
>> - *    where descr is a description of the error and ret is an int (error code for example)
>> + *    where descr is a description of the error and ret is an int
>> + *    (error code for example)
>>   * FAILED(descr);
>>   *    where descr is a short text saying why the test has failed.
>>   * PASSED();
>> @@ -67,16 +69,16 @@
>>   * Those may be used to output information.
>>   */
>>  
>> -/********************************************************************************************/
>> -/********************************** Configuration ******************************************/
>> -/********************************************************************************************/
>> +/***************************************************************/
>> +/************************ Configuration ************************/
>> +/***************************************************************/
>>  #ifndef VERBOSE
>>  #define VERBOSE 1
>>  #endif
>>  
>> -/********************************************************************************************/
>> -/***********************************     Helper     *****************************************/
>> -/********************************************************************************************/
>> +/***************************************************************/
>> +/***********************     Helper     ************************/
>> +/***************************************************************/
>>  #include "../testfrmw/threads_scenarii.c"
>>  /* this file defines:
>>  * scenarii: array of struct __scenario type.
>> @@ -85,14 +87,14 @@
>>  * scenar_fini(): function to call after end of use of the scenarii array.
>>  */
>>  
>> -/********************************************************************************************/
>> -/***********************************    Test case   *****************************************/
>> -/********************************************************************************************/
>> +/***************************************************************/
>> +/***********************    Test case   ************************/
>> +/***************************************************************/
>>  
>>  pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
>>  
>>  /* 1st thread function */
>> -void * threaded (void * arg)
>> +void *threaded(void *arg)
>>  {
>>  	int ret = 0;
>>  
>> @@ -101,22 +103,18 @@ void * threaded (void * arg)
>>  	ret = pthread_mutex_lock(&mtx);
>>  
>>  	if (ret != 0)
>> -	{
>>  		UNRESOLVED(ret, "Failed to lock mutex");
>> -	}
>>  
>>  	ret = pthread_mutex_unlock(&mtx);
>>  
>>  	if (ret != 0)
>> -	{
>>  		UNRESOLVED(ret, "Failed to unlock mutex");
>> -	}
>>  
>>  	return NULL;
>>  }
>>  
>>  /* Canceled thread */
>> -void * joiner_func(void * arg)
>> +void *joiner_func(void *arg)
>>  {
>>  	(void) pthread_join(*(pthread_t *) arg, NULL);
>>  
>> @@ -139,70 +137,64 @@ int main(int argc, char *argv[])
>>  	/* Initialize thread attribute objects */
>>  	scenar_init();
>>  
>> -	for (sc = 0; sc < NSCENAR; sc++)
>> -	{
>> +	for (sc = 0; sc < NSCENAR; sc++) {
>>  #if VERBOSE > 0
>>  		output("-----\n");
>> -		output("Starting test with scenario (%i): %s\n", sc, scenarii[ sc ].descr);
>> +		output("Starting test with scenario (%i): %s\n",
>> +					sc, scenarii[sc].descr);
>>  #endif
>>  
>>  		/* Lock the mutex */
>>  		ret = pthread_mutex_lock(&mtx);
>>  
>>  		if (ret != 0)
>> -		{
>>  			UNRESOLVED(ret, "failed to lock the mutex");
>> -		}
>> -
>> -		ret = pthread_create(&child, &scenarii[ sc ].ta, threaded, NULL);
>>  
>> -		switch (scenarii[ sc ].result)
>> -		{
>> -				case 0:                                       /* Operation was expected to succeed */
>> +		ret = pthread_create(&child, &scenarii[sc].ta, threaded,
>> +									NULL);
>>  
>> -				if (ret != 0)
>> -				{
>> -					UNRESOLVED(ret, "Failed to create this thread");
>> -				}
>> +		switch (scenarii[sc].result) {
>> +		/* Operation was expected to succeed */
>> +		case 0:
>>  
>> -				break;
>> -
>> -				case 1:                                       /* Operation was expected to fail */
>> +			if (ret != 0)
>> +				UNRESOLVED(ret, "Failed to create this thread");
>>  
>> -				if (ret == 0)
>> -				{
>> -					UNRESOLVED(-1, "An error was expected but the thread creation succeeded");
>> -				}
>> +			break;
>> +		/* Operation was expected to fail */
>> +		case 1:
>>  
>> -				break;
>> +			if (ret == 0)
>> +				UNRESOLVED(-1, "An error was expected \
>> +					but the thread creation succeeded");
>>  
>> -				case 2:                                       /* We did not know the expected result */
>> -				default:
>> +			break;
>> +		/* We did not know the expected result */
>> +		case 2:
>> +		default:
>>  #if VERBOSE > 0
>>  
>> -				if (ret == 0)
>> -				{
>> -					output("Thread has been created successfully for this scenario\n");
>> -				}
>> -				else
>> -				{
>> -					output("Thread creation failed with the error: %s\n", strerror(ret));
>> -				}
>> +			if (ret == 0) {
>> +				output("Thread has been created \
>> +					successfully for this scenario\n");
>> +			} else {
>> +				output("Thread creation failed with the error:\
>> +							%s\n", strerror(ret));
>> +			}
>>  
>>  #endif
>>  
>>  		}
>> -
>> -		if (ret == 0)                                       /* The new thread is running */
>> -		{
>> +		/* The new thread is running */
>> +		if (ret == 0) {
>>  
>>  			/* Now create the joiner thread */
>> -			ret = pthread_create(&joiner, NULL, joiner_func, &child);
>> +			ret = pthread_create(&joiner, NULL, joiner_func,
>> +								&child);
>>  
>>  			if (ret != 0)
>> -			{
>> -				UNRESOLVED(ret, "Failed to create the joiner thread");
>> -			}
>> +				UNRESOLVED(ret, "Failed to create the \
>> +								joiner thread");
>>  
>>  			/* Let it enter pthread_join */
>>  			sched_yield();
>> @@ -211,44 +203,34 @@ int main(int argc, char *argv[])
>>  			ret = pthread_cancel(joiner);
>>  
>>  			if (ret != 0)
>> -			{
>>  				UNRESOLVED(ret, "Failed to cancel the thread");
>> -			}
>>  
>>  			/* Join the canceled thread */
>>  			ret = pthread_join(joiner, NULL);
>>  
>>  			if (ret != 0)
>> -			{
>> -				UNRESOLVED(ret, "Failed to join the canceled thread");
>> -			}
>> +				UNRESOLVED(ret, "Failed to join \
>> +							the canceled thread");
>>  
>>  			/* Unblock the child thread */
>>  			ret = pthread_mutex_unlock(&mtx);
>>  
>>  			if (ret != 0)
>> -			{
>>  				UNRESOLVED(ret, "Failed to unlock the mutex");
>> -			}
>>  
>>  			/* Check the first thread is still joinable */
>>  			ret = pthread_join(child, NULL);
>>  
>> -			if (ret != 0)
>> -			{
>> +			if (ret != 0) {
>>  				output("Error returned: %d\n");
>>  				FAILED("The thread is no more joinable");
>>  			}
>>  
>> -		}
>> -		else
>> -		{
>> +		} else {
>>  			ret = pthread_mutex_unlock(&mtx);
>>  
>>  			if (ret != 0)
>> -			{
>>  				UNRESOLVED(ret, "Failed to unlock the mutex");
>> -			}
>>  		}
>>  	}
>>  
> 
> 
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here 
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [LTP]  [PATCHv2]pthread_join:4-1.c: clean up code
  2012-03-28  6:17 ` Caspar Zhang
  2012-03-28  6:44   ` Wanlong Gao
@ 2012-03-28  7:31   ` lidan
  2012-03-28  7:39     ` Wanlong Gao
  2012-03-29  6:07     ` Caspar Zhang
  1 sibling, 2 replies; 7+ messages in thread
From: lidan @ 2012-03-28  7:31 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: ltp-list


sorry for using old version checkpatch.pl.

code cleanup for pthread_join/4-1.c

Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
---
 .../conformance/interfaces/pthread_join/4-1.c      |  159 ++++++--------------
 1 file changed, 43 insertions(+), 116 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
index baf0992..fb8c8d3 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
@@ -1,7 +1,7 @@
 /*
 * Copyright (c) 2005, Bull S.A..  All rights reserved.
 * Created by: Sebastien Decugis
-
+*
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
@@ -13,27 +13,23 @@
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write the Free Software Foundation, Inc., 59
 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
-
+*
 * This sample test aims to check the following assertion:
 *
-* If the thread calling pthread_join is canceled, the joined thread remains joinable.
-
+* If the thread calling pthread_join is canceled, the joined thread
+* remains joinable.
+*
 * The steps are:
 * -> create a thread blocked on a mutex.
 * -> create another thread which tries and join the first thread.
 * -> cancel the 2nd thread.
 * -> unblock the semaphore then join the 1st thread
-
 * The test fails if the main thread is unable to join the 1st thread.
-
 */
 
 /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
 #define _POSIX_C_SOURCE 200112L
 
-/********************************************************************************************/
-/****************************** standard includes *****************************************/
-/********************************************************************************************/
 #include <pthread.h>
 #include <stdarg.h>
 #include <stdio.h>
@@ -41,82 +37,37 @@
 #include <string.h>
 #include <unistd.h>
 #include <semaphore.h>
-
 #include <errno.h>
 
-/********************************************************************************************/
-/******************************   Test framework   *****************************************/
-/********************************************************************************************/
 #include "../testfrmw/testfrmw.h"
 #include "../testfrmw/testfrmw.c"
-/* This header is responsible for defining the following macros:
- * UNRESOLVED(ret, descr);
- *    where descr is a description of the error and ret is an int (error code for example)
- * FAILED(descr);
- *    where descr is a short text saying why the test has failed.
- * PASSED();
- *    No parameter.
- *
- * Both three macros shall terminate the calling process.
- * The testcase shall not terminate in any other maneer.
- *
- * The other file defines the functions
- * void output_init()
- * void output(char * string, ...)
- *
- * Those may be used to output information.
- */
-
-/********************************************************************************************/
-/********************************** Configuration ******************************************/
-/********************************************************************************************/
 #ifndef VERBOSE
 #define VERBOSE 1
 #endif
 
-/********************************************************************************************/
-/***********************************     Helper     *****************************************/
-/********************************************************************************************/
 #include "../testfrmw/threads_scenarii.c"
-/* this file defines:
-* scenarii: array of struct __scenario type.
-* NSCENAR : macro giving the total # of scenarii
-* scenar_init(): function to call before use the scenarii array.
-* scenar_fini(): function to call after end of use of the scenarii array.
-*/
-
-/********************************************************************************************/
-/***********************************    Test case   *****************************************/
-/********************************************************************************************/
 
 pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
 
 /* 1st thread function */
-void * threaded (void * arg)
+void *threaded(void *arg)
 {
 	int ret = 0;
 
 	/* Try and lock the mutex, then exit */
-
 	ret = pthread_mutex_lock(&mtx);
-
 	if (ret != 0)
-	{
 		UNRESOLVED(ret, "Failed to lock mutex");
-	}
 
 	ret = pthread_mutex_unlock(&mtx);
-
 	if (ret != 0)
-	{
 		UNRESOLVED(ret, "Failed to unlock mutex");
-	}
 
 	return NULL;
 }
 
 /* Canceled thread */
-void * joiner_func(void * arg)
+void *joiner_func(void *arg)
 {
 	(void) pthread_join(*(pthread_t *) arg, NULL);
 
@@ -139,116 +90,92 @@ int main(int argc, char *argv[])
 	/* Initialize thread attribute objects */
 	scenar_init();
 
-	for (sc = 0; sc < NSCENAR; sc++)
-	{
+	for (sc = 0; sc < NSCENAR; sc++) {
 #if VERBOSE > 0
 		output("-----\n");
-		output("Starting test with scenario (%i): %s\n", sc, scenarii[ sc ].descr);
+		output("Starting test with scenario (%i): %s\n",
+		       sc, scenarii[sc].descr);
 #endif
 
 		/* Lock the mutex */
 		ret = pthread_mutex_lock(&mtx);
-
 		if (ret != 0)
-		{
 			UNRESOLVED(ret, "failed to lock the mutex");
-		}
 
-		ret = pthread_create(&child, &scenarii[ sc ].ta, threaded, NULL);
+		ret = pthread_create(&child, &scenarii[sc].ta,
+				     threaded, NULL);
 
-		switch (scenarii[ sc ].result)
-		{
-				case 0:                                       /* Operation was expected to succeed */
+		switch (scenarii[sc].result) {
+		/* Operation was expected to succeed */
+		case 0:
 
-				if (ret != 0)
-				{
-					UNRESOLVED(ret, "Failed to create this thread");
-				}
-
-				break;
-
-				case 1:                                       /* Operation was expected to fail */
+			if (ret != 0)
+				UNRESOLVED(ret, "Failed to create this thread");
 
-				if (ret == 0)
-				{
-					UNRESOLVED(-1, "An error was expected but the thread creation succeeded");
-				}
+			break;
+		/* Operation was expected to fail */
+		case 1:
 
-				break;
+			if (ret == 0)
+				UNRESOLVED(-1, "An error was expected "
+					   "but the thread creation succeeded");
 
-				case 2:                                       /* We did not know the expected result */
-				default:
+			break;
+		/* We did not know the expected result */
+		case 2:
+		default:
 #if VERBOSE > 0
 
-				if (ret == 0)
-				{
-					output("Thread has been created successfully for this scenario\n");
-				}
-				else
-				{
-					output("Thread creation failed with the error: %s\n", strerror(ret));
-				}
+			if (ret == 0)
+				output("Thread has been created "
+				       "successfully for this scenario\n");
+			else
+				output("Thread creation failed with the error: "
+				       "%s\n", strerror(ret));
 
 #endif
 
 		}
-
-		if (ret == 0)                                       /* The new thread is running */
-		{
-
+		/* The new thread is running */
+		if (ret == 0) {
 			/* Now create the joiner thread */
-			ret = pthread_create(&joiner, NULL, joiner_func, &child);
+			ret = pthread_create(&joiner, NULL,
+					     joiner_func, &child);
 
 			if (ret != 0)
-			{
-				UNRESOLVED(ret, "Failed to create the joiner thread");
-			}
+				UNRESOLVED(ret, "Failed to create the "
+					   "joiner thread");
 
 			/* Let it enter pthread_join */
 			sched_yield();
 
 			/* Cancel the joiner thread */
 			ret = pthread_cancel(joiner);
-
 			if (ret != 0)
-			{
 				UNRESOLVED(ret, "Failed to cancel the thread");
-			}
 
 			/* Join the canceled thread */
 			ret = pthread_join(joiner, NULL);
-
 			if (ret != 0)
-			{
-				UNRESOLVED(ret, "Failed to join the canceled thread");
-			}
+				UNRESOLVED(ret, "Failed to join the "
+					   "canceled thread");
 
 			/* Unblock the child thread */
 			ret = pthread_mutex_unlock(&mtx);
-
 			if (ret != 0)
-			{
 				UNRESOLVED(ret, "Failed to unlock the mutex");
-			}
 
 			/* Check the first thread is still joinable */
 			ret = pthread_join(child, NULL);
-
-			if (ret != 0)
-			{
+			if (ret != 0) {
 				output("Error returned: %d\n");
 				FAILED("The thread is no more joinable");
 			}
 
-		}
-		else
-		{
+		} else {
 			ret = pthread_mutex_unlock(&mtx);
-
 			if (ret != 0)
-			{
 				UNRESOLVED(ret, "Failed to unlock the mutex");
-			}
 		}
 	}
 
-- 
1.7.10.rc1

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCHv2]pthread_join:4-1.c: clean up code
  2012-03-28  7:31   ` [LTP] [PATCHv2]pthread_join:4-1.c: " lidan
@ 2012-03-28  7:39     ` Wanlong Gao
  2012-03-29  6:07     ` Caspar Zhang
  1 sibling, 0 replies; 7+ messages in thread
From: Wanlong Gao @ 2012-03-28  7:39 UTC (permalink / raw)
  To: lidan; +Cc: ltp-list

On 03/28/2012 03:31 PM, lidan wrote:

> 
> sorry for using old version checkpatch.pl.
> 
> code cleanup for pthread_join/4-1.c


ACK

> 
> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> ---
>  .../conformance/interfaces/pthread_join/4-1.c      |  159 ++++++--------------
>  1 file changed, 43 insertions(+), 116 deletions(-)
> 
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> index baf0992..fb8c8d3 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> @@ -1,7 +1,7 @@
>  /*
>  * Copyright (c) 2005, Bull S.A..  All rights reserved.
>  * Created by: Sebastien Decugis
> -
> +*
>  * This program is free software; you can redistribute it and/or modify it
>  * under the terms of version 2 of the GNU General Public License as
>  * published by the Free Software Foundation.
> @@ -13,27 +13,23 @@
>  * You should have received a copy of the GNU General Public License along
>  * with this program; if not, write the Free Software Foundation, Inc., 59
>  * Temple Place - Suite 330, Boston MA 02111-1307, USA.
> -
> +*
>  * This sample test aims to check the following assertion:
>  *
> -* If the thread calling pthread_join is canceled, the joined thread remains joinable.
> -
> +* If the thread calling pthread_join is canceled, the joined thread
> +* remains joinable.
> +*
>  * The steps are:
>  * -> create a thread blocked on a mutex.
>  * -> create another thread which tries and join the first thread.
>  * -> cancel the 2nd thread.
>  * -> unblock the semaphore then join the 1st thread
> -
>  * The test fails if the main thread is unable to join the 1st thread.
> -
>  */
>  
>  /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
>  #define _POSIX_C_SOURCE 200112L
>  
> -/********************************************************************************************/
> -/****************************** standard includes *****************************************/
> -/********************************************************************************************/
>  #include <pthread.h>
>  #include <stdarg.h>
>  #include <stdio.h>
> @@ -41,82 +37,37 @@
>  #include <string.h>
>  #include <unistd.h>
>  #include <semaphore.h>
> -
>  #include <errno.h>
>  
> -/********************************************************************************************/
> -/******************************   Test framework   *****************************************/
> -/********************************************************************************************/
>  #include "../testfrmw/testfrmw.h"
>  #include "../testfrmw/testfrmw.c"
> -/* This header is responsible for defining the following macros:
> - * UNRESOLVED(ret, descr);
> - *    where descr is a description of the error and ret is an int (error code for example)
> - * FAILED(descr);
> - *    where descr is a short text saying why the test has failed.
> - * PASSED();
> - *    No parameter.
> - *
> - * Both three macros shall terminate the calling process.
> - * The testcase shall not terminate in any other maneer.
> - *
> - * The other file defines the functions
> - * void output_init()
> - * void output(char * string, ...)
> - *
> - * Those may be used to output information.
> - */
> -
> -/********************************************************************************************/
> -/********************************** Configuration ******************************************/
> -/********************************************************************************************/
>  #ifndef VERBOSE
>  #define VERBOSE 1
>  #endif
>  
> -/********************************************************************************************/
> -/***********************************     Helper     *****************************************/
> -/********************************************************************************************/
>  #include "../testfrmw/threads_scenarii.c"
> -/* this file defines:
> -* scenarii: array of struct __scenario type.
> -* NSCENAR : macro giving the total # of scenarii
> -* scenar_init(): function to call before use the scenarii array.
> -* scenar_fini(): function to call after end of use of the scenarii array.
> -*/
> -
> -/********************************************************************************************/
> -/***********************************    Test case   *****************************************/
> -/********************************************************************************************/
>  
>  pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
>  
>  /* 1st thread function */
> -void * threaded (void * arg)
> +void *threaded(void *arg)
>  {
>  	int ret = 0;
>  
>  	/* Try and lock the mutex, then exit */
> -
>  	ret = pthread_mutex_lock(&mtx);
> -
>  	if (ret != 0)
> -	{
>  		UNRESOLVED(ret, "Failed to lock mutex");
> -	}
>  
>  	ret = pthread_mutex_unlock(&mtx);
> -
>  	if (ret != 0)
> -	{
>  		UNRESOLVED(ret, "Failed to unlock mutex");
> -	}
>  
>  	return NULL;
>  }
>  
>  /* Canceled thread */
> -void * joiner_func(void * arg)
> +void *joiner_func(void *arg)
>  {
>  	(void) pthread_join(*(pthread_t *) arg, NULL);
>  
> @@ -139,116 +90,92 @@ int main(int argc, char *argv[])
>  	/* Initialize thread attribute objects */
>  	scenar_init();
>  
> -	for (sc = 0; sc < NSCENAR; sc++)
> -	{
> +	for (sc = 0; sc < NSCENAR; sc++) {
>  #if VERBOSE > 0
>  		output("-----\n");
> -		output("Starting test with scenario (%i): %s\n", sc, scenarii[ sc ].descr);
> +		output("Starting test with scenario (%i): %s\n",
> +		       sc, scenarii[sc].descr);
>  #endif
>  
>  		/* Lock the mutex */
>  		ret = pthread_mutex_lock(&mtx);
> -
>  		if (ret != 0)
> -		{
>  			UNRESOLVED(ret, "failed to lock the mutex");
> -		}
>  
> -		ret = pthread_create(&child, &scenarii[ sc ].ta, threaded, NULL);
> +		ret = pthread_create(&child, &scenarii[sc].ta,
> +				     threaded, NULL);
>  
> -		switch (scenarii[ sc ].result)
> -		{
> -				case 0:                                       /* Operation was expected to succeed */
> +		switch (scenarii[sc].result) {
> +		/* Operation was expected to succeed */
> +		case 0:
>  
> -				if (ret != 0)
> -				{
> -					UNRESOLVED(ret, "Failed to create this thread");
> -				}
> -
> -				break;
> -
> -				case 1:                                       /* Operation was expected to fail */
> +			if (ret != 0)
> +				UNRESOLVED(ret, "Failed to create this thread");
>  
> -				if (ret == 0)
> -				{
> -					UNRESOLVED(-1, "An error was expected but the thread creation succeeded");
> -				}
> +			break;
> +		/* Operation was expected to fail */
> +		case 1:
>  
> -				break;
> +			if (ret == 0)
> +				UNRESOLVED(-1, "An error was expected "
> +					   "but the thread creation succeeded");
>  
> -				case 2:                                       /* We did not know the expected result */
> -				default:
> +			break;
> +		/* We did not know the expected result */
> +		case 2:
> +		default:
>  #if VERBOSE > 0
>  
> -				if (ret == 0)
> -				{
> -					output("Thread has been created successfully for this scenario\n");
> -				}
> -				else
> -				{
> -					output("Thread creation failed with the error: %s\n", strerror(ret));
> -				}
> +			if (ret == 0)
> +				output("Thread has been created "
> +				       "successfully for this scenario\n");
> +			else
> +				output("Thread creation failed with the error: "
> +				       "%s\n", strerror(ret));
>  
>  #endif
>  
>  		}
> -
> -		if (ret == 0)                                       /* The new thread is running */
> -		{
> -
> +		/* The new thread is running */
> +		if (ret == 0) {
>  			/* Now create the joiner thread */
> -			ret = pthread_create(&joiner, NULL, joiner_func, &child);
> +			ret = pthread_create(&joiner, NULL,
> +					     joiner_func, &child);
>  
>  			if (ret != 0)
> -			{
> -				UNRESOLVED(ret, "Failed to create the joiner thread");
> -			}
> +				UNRESOLVED(ret, "Failed to create the "
> +					   "joiner thread");
>  
>  			/* Let it enter pthread_join */
>  			sched_yield();
>  
>  			/* Cancel the joiner thread */
>  			ret = pthread_cancel(joiner);
> -
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to cancel the thread");
> -			}
>  
>  			/* Join the canceled thread */
>  			ret = pthread_join(joiner, NULL);
> -
>  			if (ret != 0)
> -			{
> -				UNRESOLVED(ret, "Failed to join the canceled thread");
> -			}
> +				UNRESOLVED(ret, "Failed to join the "
> +					   "canceled thread");
>  
>  			/* Unblock the child thread */
>  			ret = pthread_mutex_unlock(&mtx);
> -
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to unlock the mutex");
> -			}
>  
>  			/* Check the first thread is still joinable */
>  			ret = pthread_join(child, NULL);
> -
> -			if (ret != 0)
> -			{
> +			if (ret != 0) {
>  				output("Error returned: %d\n");
>  				FAILED("The thread is no more joinable");
>  			}
>  
> -		}
> -		else
> -		{
> +		} else {
>  			ret = pthread_mutex_unlock(&mtx);
> -
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to unlock the mutex");
> -			}
>  		}
>  	}
>  



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCHv2]pthread_join:4-1.c: clean up code
  2012-03-28  7:31   ` [LTP] [PATCHv2]pthread_join:4-1.c: " lidan
  2012-03-28  7:39     ` Wanlong Gao
@ 2012-03-29  6:07     ` Caspar Zhang
  2012-03-29  9:56       ` Wanlong Gao
  1 sibling, 1 reply; 7+ messages in thread
From: Caspar Zhang @ 2012-03-29  6:07 UTC (permalink / raw)
  To: lidan; +Cc: ltp-list

On 03/28/2012 03:31 PM, lidan wrote:
> 
> sorry for using old version checkpatch.pl.
> 
> code cleanup for pthread_join/4-1.c
> 
> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>

Reviewed-by: Caspar Zhang <caspar@casparzhang.com>

Wanlong, feel free to commit.

Thanks,
Caspar

> ---
>  .../conformance/interfaces/pthread_join/4-1.c      |  159 ++++++--------------
>  1 file changed, 43 insertions(+), 116 deletions(-)
> 
> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> index baf0992..fb8c8d3 100644
> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
> @@ -1,7 +1,7 @@
>  /*
>  * Copyright (c) 2005, Bull S.A..  All rights reserved.
>  * Created by: Sebastien Decugis
> -
> +*
>  * This program is free software; you can redistribute it and/or modify it
>  * under the terms of version 2 of the GNU General Public License as
>  * published by the Free Software Foundation.
> @@ -13,27 +13,23 @@
>  * You should have received a copy of the GNU General Public License along
>  * with this program; if not, write the Free Software Foundation, Inc., 59
>  * Temple Place - Suite 330, Boston MA 02111-1307, USA.
> -
> +*
>  * This sample test aims to check the following assertion:
>  *
> -* If the thread calling pthread_join is canceled, the joined thread remains joinable.
> -
> +* If the thread calling pthread_join is canceled, the joined thread
> +* remains joinable.
> +*
>  * The steps are:
>  * -> create a thread blocked on a mutex.
>  * -> create another thread which tries and join the first thread.
>  * -> cancel the 2nd thread.
>  * -> unblock the semaphore then join the 1st thread
> -
>  * The test fails if the main thread is unable to join the 1st thread.
> -
>  */
>  
>  /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
>  #define _POSIX_C_SOURCE 200112L
>  
> -/********************************************************************************************/
> -/****************************** standard includes *****************************************/
> -/********************************************************************************************/
>  #include <pthread.h>
>  #include <stdarg.h>
>  #include <stdio.h>
> @@ -41,82 +37,37 @@
>  #include <string.h>
>  #include <unistd.h>
>  #include <semaphore.h>
> -
>  #include <errno.h>
>  
> -/********************************************************************************************/
> -/******************************   Test framework   *****************************************/
> -/********************************************************************************************/
>  #include "../testfrmw/testfrmw.h"
>  #include "../testfrmw/testfrmw.c"
> -/* This header is responsible for defining the following macros:
> - * UNRESOLVED(ret, descr);
> - *    where descr is a description of the error and ret is an int (error code for example)
> - * FAILED(descr);
> - *    where descr is a short text saying why the test has failed.
> - * PASSED();
> - *    No parameter.
> - *
> - * Both three macros shall terminate the calling process.
> - * The testcase shall not terminate in any other maneer.
> - *
> - * The other file defines the functions
> - * void output_init()
> - * void output(char * string, ...)
> - *
> - * Those may be used to output information.
> - */
> -
> -/********************************************************************************************/
> -/********************************** Configuration ******************************************/
> -/********************************************************************************************/
>  #ifndef VERBOSE
>  #define VERBOSE 1
>  #endif
>  
> -/********************************************************************************************/
> -/***********************************     Helper     *****************************************/
> -/********************************************************************************************/
>  #include "../testfrmw/threads_scenarii.c"
> -/* this file defines:
> -* scenarii: array of struct __scenario type.
> -* NSCENAR : macro giving the total # of scenarii
> -* scenar_init(): function to call before use the scenarii array.
> -* scenar_fini(): function to call after end of use of the scenarii array.
> -*/
> -
> -/********************************************************************************************/
> -/***********************************    Test case   *****************************************/
> -/********************************************************************************************/
>  
>  pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
>  
>  /* 1st thread function */
> -void * threaded (void * arg)
> +void *threaded(void *arg)
>  {
>  	int ret = 0;
>  
>  	/* Try and lock the mutex, then exit */
> -
>  	ret = pthread_mutex_lock(&mtx);
> -
>  	if (ret != 0)
> -	{
>  		UNRESOLVED(ret, "Failed to lock mutex");
> -	}
>  
>  	ret = pthread_mutex_unlock(&mtx);
> -
>  	if (ret != 0)
> -	{
>  		UNRESOLVED(ret, "Failed to unlock mutex");
> -	}
>  
>  	return NULL;
>  }
>  
>  /* Canceled thread */
> -void * joiner_func(void * arg)
> +void *joiner_func(void *arg)
>  {
>  	(void) pthread_join(*(pthread_t *) arg, NULL);
>  
> @@ -139,116 +90,92 @@ int main(int argc, char *argv[])
>  	/* Initialize thread attribute objects */
>  	scenar_init();
>  
> -	for (sc = 0; sc < NSCENAR; sc++)
> -	{
> +	for (sc = 0; sc < NSCENAR; sc++) {
>  #if VERBOSE > 0
>  		output("-----\n");
> -		output("Starting test with scenario (%i): %s\n", sc, scenarii[ sc ].descr);
> +		output("Starting test with scenario (%i): %s\n",
> +		       sc, scenarii[sc].descr);
>  #endif
>  
>  		/* Lock the mutex */
>  		ret = pthread_mutex_lock(&mtx);
> -
>  		if (ret != 0)
> -		{
>  			UNRESOLVED(ret, "failed to lock the mutex");
> -		}
>  
> -		ret = pthread_create(&child, &scenarii[ sc ].ta, threaded, NULL);
> +		ret = pthread_create(&child, &scenarii[sc].ta,
> +				     threaded, NULL);
>  
> -		switch (scenarii[ sc ].result)
> -		{
> -				case 0:                                       /* Operation was expected to succeed */
> +		switch (scenarii[sc].result) {
> +		/* Operation was expected to succeed */
> +		case 0:
>  
> -				if (ret != 0)
> -				{
> -					UNRESOLVED(ret, "Failed to create this thread");
> -				}
> -
> -				break;
> -
> -				case 1:                                       /* Operation was expected to fail */
> +			if (ret != 0)
> +				UNRESOLVED(ret, "Failed to create this thread");
>  
> -				if (ret == 0)
> -				{
> -					UNRESOLVED(-1, "An error was expected but the thread creation succeeded");
> -				}
> +			break;
> +		/* Operation was expected to fail */
> +		case 1:
>  
> -				break;
> +			if (ret == 0)
> +				UNRESOLVED(-1, "An error was expected "
> +					   "but the thread creation succeeded");
>  
> -				case 2:                                       /* We did not know the expected result */
> -				default:
> +			break;
> +		/* We did not know the expected result */
> +		case 2:
> +		default:
>  #if VERBOSE > 0
>  
> -				if (ret == 0)
> -				{
> -					output("Thread has been created successfully for this scenario\n");
> -				}
> -				else
> -				{
> -					output("Thread creation failed with the error: %s\n", strerror(ret));
> -				}
> +			if (ret == 0)
> +				output("Thread has been created "
> +				       "successfully for this scenario\n");
> +			else
> +				output("Thread creation failed with the error: "
> +				       "%s\n", strerror(ret));
>  
>  #endif
>  
>  		}
> -
> -		if (ret == 0)                                       /* The new thread is running */
> -		{
> -
> +		/* The new thread is running */
> +		if (ret == 0) {
>  			/* Now create the joiner thread */
> -			ret = pthread_create(&joiner, NULL, joiner_func, &child);
> +			ret = pthread_create(&joiner, NULL,
> +					     joiner_func, &child);
>  
>  			if (ret != 0)
> -			{
> -				UNRESOLVED(ret, "Failed to create the joiner thread");
> -			}
> +				UNRESOLVED(ret, "Failed to create the "
> +					   "joiner thread");
>  
>  			/* Let it enter pthread_join */
>  			sched_yield();
>  
>  			/* Cancel the joiner thread */
>  			ret = pthread_cancel(joiner);
> -
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to cancel the thread");
> -			}
>  
>  			/* Join the canceled thread */
>  			ret = pthread_join(joiner, NULL);
> -
>  			if (ret != 0)
> -			{
> -				UNRESOLVED(ret, "Failed to join the canceled thread");
> -			}
> +				UNRESOLVED(ret, "Failed to join the "
> +					   "canceled thread");
>  
>  			/* Unblock the child thread */
>  			ret = pthread_mutex_unlock(&mtx);
> -
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to unlock the mutex");
> -			}
>  
>  			/* Check the first thread is still joinable */
>  			ret = pthread_join(child, NULL);
> -
> -			if (ret != 0)
> -			{
> +			if (ret != 0) {
>  				output("Error returned: %d\n");
>  				FAILED("The thread is no more joinable");
>  			}
>  
> -		}
> -		else
> -		{
> +		} else {
>  			ret = pthread_mutex_unlock(&mtx);
> -
>  			if (ret != 0)
> -			{
>  				UNRESOLVED(ret, "Failed to unlock the mutex");
> -			}
>  		}
>  	}
>  


------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [LTP] [PATCHv2]pthread_join:4-1.c: clean up code
  2012-03-29  6:07     ` Caspar Zhang
@ 2012-03-29  9:56       ` Wanlong Gao
  0 siblings, 0 replies; 7+ messages in thread
From: Wanlong Gao @ 2012-03-29  9:56 UTC (permalink / raw)
  To: Caspar Zhang; +Cc: ltp-list

On 03/29/2012 02:07 PM, Caspar Zhang wrote:

> On 03/28/2012 03:31 PM, lidan wrote:
>>
>> sorry for using old version checkpatch.pl.
>>
>> code cleanup for pthread_join/4-1.c
>>
>> Signed-off-by: DAN LI <li.dan@cn.fujitsu.com>
>> Signed-off-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
> 
> Reviewed-by: Caspar Zhang <caspar@casparzhang.com>
> 
> Wanlong, feel free to commit.


pushed, thanks Li and Caspar ;)

Wanlong Gao

> 
> Thanks,
> Caspar
> 
>> ---
>>  .../conformance/interfaces/pthread_join/4-1.c      |  159 ++++++--------------
>>  1 file changed, 43 insertions(+), 116 deletions(-)
>>
>> diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
>> index baf0992..fb8c8d3 100644
>> --- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
>> +++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c
>> @@ -1,7 +1,7 @@
>>  /*
>>  * Copyright (c) 2005, Bull S.A..  All rights reserved.
>>  * Created by: Sebastien Decugis
>> -
>> +*
>>  * This program is free software; you can redistribute it and/or modify it
>>  * under the terms of version 2 of the GNU General Public License as
>>  * published by the Free Software Foundation.
>> @@ -13,27 +13,23 @@
>>  * You should have received a copy of the GNU General Public License along
>>  * with this program; if not, write the Free Software Foundation, Inc., 59
>>  * Temple Place - Suite 330, Boston MA 02111-1307, USA.
>> -
>> +*
>>  * This sample test aims to check the following assertion:
>>  *
>> -* If the thread calling pthread_join is canceled, the joined thread remains joinable.
>> -
>> +* If the thread calling pthread_join is canceled, the joined thread
>> +* remains joinable.
>> +*
>>  * The steps are:
>>  * -> create a thread blocked on a mutex.
>>  * -> create another thread which tries and join the first thread.
>>  * -> cancel the 2nd thread.
>>  * -> unblock the semaphore then join the 1st thread
>> -
>>  * The test fails if the main thread is unable to join the 1st thread.
>> -
>>  */
>>  
>>  /* We are testing conformance to IEEE Std 1003.1, 2003 Edition */
>>  #define _POSIX_C_SOURCE 200112L
>>  
>> -/********************************************************************************************/
>> -/****************************** standard includes *****************************************/
>> -/********************************************************************************************/
>>  #include <pthread.h>
>>  #include <stdarg.h>
>>  #include <stdio.h>
>> @@ -41,82 +37,37 @@
>>  #include <string.h>
>>  #include <unistd.h>
>>  #include <semaphore.h>
>> -
>>  #include <errno.h>
>>  
>> -/********************************************************************************************/
>> -/******************************   Test framework   *****************************************/
>> -/********************************************************************************************/
>>  #include "../testfrmw/testfrmw.h"
>>  #include "../testfrmw/testfrmw.c"
>> -/* This header is responsible for defining the following macros:
>> - * UNRESOLVED(ret, descr);
>> - *    where descr is a description of the error and ret is an int (error code for example)
>> - * FAILED(descr);
>> - *    where descr is a short text saying why the test has failed.
>> - * PASSED();
>> - *    No parameter.
>> - *
>> - * Both three macros shall terminate the calling process.
>> - * The testcase shall not terminate in any other maneer.
>> - *
>> - * The other file defines the functions
>> - * void output_init()
>> - * void output(char * string, ...)
>> - *
>> - * Those may be used to output information.
>> - */
>> -
>> -/********************************************************************************************/
>> -/********************************** Configuration ******************************************/
>> -/********************************************************************************************/
>>  #ifndef VERBOSE
>>  #define VERBOSE 1
>>  #endif
>>  
>> -/********************************************************************************************/
>> -/***********************************     Helper     *****************************************/
>> -/********************************************************************************************/
>>  #include "../testfrmw/threads_scenarii.c"
>> -/* this file defines:
>> -* scenarii: array of struct __scenario type.
>> -* NSCENAR : macro giving the total # of scenarii
>> -* scenar_init(): function to call before use the scenarii array.
>> -* scenar_fini(): function to call after end of use of the scenarii array.
>> -*/
>> -
>> -/********************************************************************************************/
>> -/***********************************    Test case   *****************************************/
>> -/********************************************************************************************/
>>  
>>  pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
>>  
>>  /* 1st thread function */
>> -void * threaded (void * arg)
>> +void *threaded(void *arg)
>>  {
>>  	int ret = 0;
>>  
>>  	/* Try and lock the mutex, then exit */
>> -
>>  	ret = pthread_mutex_lock(&mtx);
>> -
>>  	if (ret != 0)
>> -	{
>>  		UNRESOLVED(ret, "Failed to lock mutex");
>> -	}
>>  
>>  	ret = pthread_mutex_unlock(&mtx);
>> -
>>  	if (ret != 0)
>> -	{
>>  		UNRESOLVED(ret, "Failed to unlock mutex");
>> -	}
>>  
>>  	return NULL;
>>  }
>>  
>>  /* Canceled thread */
>> -void * joiner_func(void * arg)
>> +void *joiner_func(void *arg)
>>  {
>>  	(void) pthread_join(*(pthread_t *) arg, NULL);
>>  
>> @@ -139,116 +90,92 @@ int main(int argc, char *argv[])
>>  	/* Initialize thread attribute objects */
>>  	scenar_init();
>>  
>> -	for (sc = 0; sc < NSCENAR; sc++)
>> -	{
>> +	for (sc = 0; sc < NSCENAR; sc++) {
>>  #if VERBOSE > 0
>>  		output("-----\n");
>> -		output("Starting test with scenario (%i): %s\n", sc, scenarii[ sc ].descr);
>> +		output("Starting test with scenario (%i): %s\n",
>> +		       sc, scenarii[sc].descr);
>>  #endif
>>  
>>  		/* Lock the mutex */
>>  		ret = pthread_mutex_lock(&mtx);
>> -
>>  		if (ret != 0)
>> -		{
>>  			UNRESOLVED(ret, "failed to lock the mutex");
>> -		}
>>  
>> -		ret = pthread_create(&child, &scenarii[ sc ].ta, threaded, NULL);
>> +		ret = pthread_create(&child, &scenarii[sc].ta,
>> +				     threaded, NULL);
>>  
>> -		switch (scenarii[ sc ].result)
>> -		{
>> -				case 0:                                       /* Operation was expected to succeed */
>> +		switch (scenarii[sc].result) {
>> +		/* Operation was expected to succeed */
>> +		case 0:
>>  
>> -				if (ret != 0)
>> -				{
>> -					UNRESOLVED(ret, "Failed to create this thread");
>> -				}
>> -
>> -				break;
>> -
>> -				case 1:                                       /* Operation was expected to fail */
>> +			if (ret != 0)
>> +				UNRESOLVED(ret, "Failed to create this thread");
>>  
>> -				if (ret == 0)
>> -				{
>> -					UNRESOLVED(-1, "An error was expected but the thread creation succeeded");
>> -				}
>> +			break;
>> +		/* Operation was expected to fail */
>> +		case 1:
>>  
>> -				break;
>> +			if (ret == 0)
>> +				UNRESOLVED(-1, "An error was expected "
>> +					   "but the thread creation succeeded");
>>  
>> -				case 2:                                       /* We did not know the expected result */
>> -				default:
>> +			break;
>> +		/* We did not know the expected result */
>> +		case 2:
>> +		default:
>>  #if VERBOSE > 0
>>  
>> -				if (ret == 0)
>> -				{
>> -					output("Thread has been created successfully for this scenario\n");
>> -				}
>> -				else
>> -				{
>> -					output("Thread creation failed with the error: %s\n", strerror(ret));
>> -				}
>> +			if (ret == 0)
>> +				output("Thread has been created "
>> +				       "successfully for this scenario\n");
>> +			else
>> +				output("Thread creation failed with the error: "
>> +				       "%s\n", strerror(ret));
>>  
>>  #endif
>>  
>>  		}
>> -
>> -		if (ret == 0)                                       /* The new thread is running */
>> -		{
>> -
>> +		/* The new thread is running */
>> +		if (ret == 0) {
>>  			/* Now create the joiner thread */
>> -			ret = pthread_create(&joiner, NULL, joiner_func, &child);
>> +			ret = pthread_create(&joiner, NULL,
>> +					     joiner_func, &child);
>>  
>>  			if (ret != 0)
>> -			{
>> -				UNRESOLVED(ret, "Failed to create the joiner thread");
>> -			}
>> +				UNRESOLVED(ret, "Failed to create the "
>> +					   "joiner thread");
>>  
>>  			/* Let it enter pthread_join */
>>  			sched_yield();
>>  
>>  			/* Cancel the joiner thread */
>>  			ret = pthread_cancel(joiner);
>> -
>>  			if (ret != 0)
>> -			{
>>  				UNRESOLVED(ret, "Failed to cancel the thread");
>> -			}
>>  
>>  			/* Join the canceled thread */
>>  			ret = pthread_join(joiner, NULL);
>> -
>>  			if (ret != 0)
>> -			{
>> -				UNRESOLVED(ret, "Failed to join the canceled thread");
>> -			}
>> +				UNRESOLVED(ret, "Failed to join the "
>> +					   "canceled thread");
>>  
>>  			/* Unblock the child thread */
>>  			ret = pthread_mutex_unlock(&mtx);
>> -
>>  			if (ret != 0)
>> -			{
>>  				UNRESOLVED(ret, "Failed to unlock the mutex");
>> -			}
>>  
>>  			/* Check the first thread is still joinable */
>>  			ret = pthread_join(child, NULL);
>> -
>> -			if (ret != 0)
>> -			{
>> +			if (ret != 0) {
>>  				output("Error returned: %d\n");
>>  				FAILED("The thread is no more joinable");
>>  			}
>>  
>> -		}
>> -		else
>> -		{
>> +		} else {
>>  			ret = pthread_mutex_unlock(&mtx);
>> -
>>  			if (ret != 0)
>> -			{
>>  				UNRESOLVED(ret, "Failed to unlock the mutex");
>> -			}
>>  		}
>>  	}
>>  
> 
> 
> ------------------------------------------------------------------------------
> This SF email is sponsosred by:
> Try Windows Azure free for 90 days Click Here 
> http://p.sf.net/sfu/sfd2d-msazure
> _______________________________________________
> Ltp-list mailing list
> Ltp-list@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 



------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-03-29  9:57 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-28  6:10 [LTP] [PATCH]pthread_join:4-1.c: clean up code lidan
2012-03-28  6:17 ` Caspar Zhang
2012-03-28  6:44   ` Wanlong Gao
2012-03-28  7:31   ` [LTP] [PATCHv2]pthread_join:4-1.c: " lidan
2012-03-28  7:39     ` Wanlong Gao
2012-03-29  6:07     ` Caspar Zhang
2012-03-29  9:56       ` Wanlong Gao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.