Skip to contentSkip to conversation

Destroy mutex an mutex_attr object at end of test

PATCH In review Bian Naimeng 2 participants 3 messages Nov 18, 2010 – Nov 22, 2010 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Destroy mutex an mutex_attr object at end of test

Destroy mutex an mutex_attr object at end of test.

---
 .../interfaces/pthread_mutex_getprioceiling/3-1.c  |    2 ++
 .../interfaces/pthread_mutex_getprioceiling/3-2.c  |    3 +++
 .../interfaces/pthread_mutex_getprioceiling/3-3.c  |    3 +++
 3 files changed, 8 insertions(+), 0 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c +2 -0
index d96ae43..5267b63 100644
@@ -62,6 +62,8 @@ main(void)
 	} else
 		printf("pthread_mutex_getprioceiling passed unexpectedly\n");
 
+	(void) pthread_mutex_destroy(&mutex);
+
 	return (error == EINVAL ? PTS_PASS : PTS_FAIL);
 #else
 	printf("pthread_mutex_getprioceiling not supported");
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c +3 -0
index 843c048..afa12c1 100644
@@ -75,6 +75,9 @@ main(void)
 	} else
 		printf("pthread_mutex_getprioceiling passed unexpectedly\n");
 
+	(void) pthread_mutexattr_destroy(&mutex_attr);
+	(void) pthread_mutex_destroy(&mutex);
+
 	return (error == EINVAL ? PTS_PASS : PTS_FAIL);
 #else
 	printf("pthread_mutex_getprioceiling not supported");
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c +3 -0
index cf46f77..4aa6b1c 100644
@@ -76,6 +76,9 @@ main(void)
 	} else
 		printf("pthread_mutex_getprioceiling passed unexpectedly\n");
 
+	(void) pthread_mutexattr_destroy(&mutex_attr);
+	(void) pthread_mutex_destroy(&mutex);
+
 	return (error == EINVAL ? PTS_PASS : PTS_UNRESOLVED);
 #else
 	printf("pthread_mutex_getprioceiling not supported");
Signature · 14 lines
1.7.0.4



------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hi!

Quoted 15 lines

Destroy mutex an mutex_attr object at end of test.

---
 .../interfaces/pthread_mutex_getprioceiling/3-1.c  |    2 ++
 .../interfaces/pthread_mutex_getprioceiling/3-2.c  |    3 +++
 .../interfaces/pthread_mutex_getprioceiling/3-3.c  |    3 +++
 3 files changed, 8 insertions(+), 0 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c +0 -0
index d96ae43..5267b63 100644

testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c main(void) · line 66

Quoted 5 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c +2 -0
@@ -62,6 +62,8 @@ main(void)
 	} else
 		printf("pthread_mutex_getprioceiling passed unexpectedly\n");
 
+	(void) pthread_mutex_destroy(&mutex);
+

Please never use useless cast like this.

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c +0 -0
 	return (error == EINVAL ? PTS_PASS : PTS_FAIL);
 #else
 	printf("pthread_mutex_getprioceiling not supported");
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c +0 -0
index 843c048..afa12c1 100644

testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c main(void) · line 80

Quoted 6 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c +3 -0
@@ -75,6 +75,9 @@ main(void)
 	} else
 		printf("pthread_mutex_getprioceiling passed unexpectedly\n");
 
+	(void) pthread_mutexattr_destroy(&mutex_attr);
+	(void) pthread_mutex_destroy(&mutex);
+

And here.

Quoted 8 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-2.c +0 -0
 	return (error == EINVAL ? PTS_PASS : PTS_FAIL);
 #else
 	printf("pthread_mutex_getprioceiling not supported");
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c +0 -0
index cf46f77..4aa6b1c 100644

testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c main(void) · line 81

Quoted 6 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c +3 -0
@@ -76,6 +76,9 @@ main(void)
 	} else
 		printf("pthread_mutex_getprioceiling passed unexpectedly\n");
 
+	(void) pthread_mutexattr_destroy(&mutex_attr);
+	(void) pthread_mutex_destroy(&mutex);
+

And here.

Quoted 5 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-3.c +0 -0
 	return (error == EINVAL ? PTS_PASS : PTS_UNRESOLVED);
 #else
 	printf("pthread_mutex_getprioceiling not supported");
Signature · 1 line
1.7.0.4
Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Hi!

Quoted 23 lines
Quoted 18 lines
Quoted 18 lines

Destroy mutex an mutex_attr object at end of test.

---

 .../interfaces/pthread_mutex_getprioceiling/3-1.c  |    2 ++
 .../interfaces/pthread_mutex_getprioceiling/3-2.c  |    3 +++
 .../interfaces/pthread_mutex_getprioceiling/3-3.c  |    3 +++
 3 files changed, 8 insertions(+), 0 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c +0 -0
index d96ae43..5267b63 100644
@@ -62,6 +62,8 @@ main(void)
       } else
               printf("pthread_mutex_getprioceiling passed unexpectedly\n");
 
Quoted 4 lines

testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c main(void) · line 66

Quoted 2 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_mutex_getprioceiling/3-1.c +2 -0
+     (void) pthread_mutex_destroy(&mutex);
+

Please never use useless cast like this.

Quoted 9 lines

Bian was following my example. I've gotten into the habit of doing this on calls like this because later versions of glibc start whining about blind calls to libcalls / syscalls (take open, write, etc for instance) where the developer doesn't check the return code. I did this to shut up that whining (because the return code isn't important for the overall intent of this testcase), and because I wanted to be explicit about the fact that the return code is ignored for human readers.

Okay.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list