Skip to contentSkip to conversation

pthread_join:4-1.c:ignore detached thread

PATCH In review lidan 2 participants 3 messages Mar 29, 2012 – Mar 30, 2012

lore
Share & tools
lore

lidan

author
#0 lore raw

PATCH 1/1 pthread_join:4-1.c:ignore detached thread

Case pthread_join/4-1.c aims to check the following assertion "If the thread calling pthread_join is canceled, the joined thread remains joinable."
It uses array scenarii defined in "threads_scenarii.c" which sets attribute of some threads as detached.
This patch ignores the detached threads since once a thread has been detached, it can't be joined with pthread_join(3) or be made joinable again.

---
 .../conformance/interfaces/pthread_join/4-1.c      |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c +3 -0
index fb8c8d3..16ac7e8 100644
@@ -91,6 +91,9 @@ int main(int argc, char *argv[])
 	scenar_init();
 
 	for (sc = 0; sc < NSCENAR; sc++) {
+		if (scenarii[sc].detached == 1)
+			continue;
+
 #if VERBOSE > 0
 		output("-----\n");
 		output("Starting test with scenario (%i): %s\n",
Signature · 10 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw
Quoted 8 lines · lidan

Case pthread_join/4-1.c aims to check the following assertion "If the thread calling pthread_join is canceled, the joined thread remains joinable."
It uses array scenarii defined in "threads_scenarii.c" which sets attribute of some threads as detached.
This patch ignores the detached threads since once a thread has been detached, it can't be joined with pthread_join(3) or be made joinable again.

Looks good to me, any other comments?

Thanks,
Wanlong Gao

Quoted 12 lines
---
 .../conformance/interfaces/pthread_join/4-1.c      |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c +0 -0
index fb8c8d3..16ac7e8 100644

testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c int main(int argc, char *argv[]) · line 99

Quoted 9 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c +3 -0
@@ -91,6 +91,9 @@ int main(int argc, char *argv[])
 	scenar_init();
 
 	for (sc = 0; sc < NSCENAR; sc++) {
+		if (scenarii[sc].detached == 1)
+			continue;
+
 #if VERBOSE > 0
 		output("-----\n");
 		output("Starting test with scenario (%i): %s\n",

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
In reply to lidan
Quoted 8 lines · lidan

Case pthread_join/4-1.c aims to check the following assertion "If the thread calling pthread_join is canceled, the joined thread remains joinable."
It uses array scenarii defined in "threads_scenarii.c" which sets attribute of some threads as detached.
This patch ignores the detached threads since once a thread has been detached, it can't be joined with pthread_join(3) or be made joinable again.

pushed, thanks,

Wanlong Gao

Quoted 12 lines
---
 .../conformance/interfaces/pthread_join/4-1.c      |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c +0 -0
index fb8c8d3..16ac7e8 100644

testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c int main(int argc, char *argv[]) · line 99

Quoted 9 lines
testcases/open_posix_testsuite/conformance/interfaces/pthread_join/4-1.c +3 -0
@@ -91,6 +91,9 @@ int main(int argc, char *argv[])
 	scenar_init();
 
 	for (sc = 0; sc < NSCENAR; sc++) {
+		if (scenarii[sc].detached == 1)
+			continue;
+
 #if VERBOSE > 0
 		output("-----\n");
 		output("Starting test with scenario (%i): %s\n",

------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list