public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] pthread_cond_signal: don't count pthread_cond_signals
@ 2012-08-23  6:55 Jan Stancek
  2012-08-23  8:16 ` Kang Kai
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Stancek @ 2012-08-23  6:55 UTC (permalink / raw)
  To: ltp-list

Don't count how many pthread_cond_signals it took,
if any fails SIGALRM will trigger testcase failure.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 .../interfaces/pthread_cond_signal/1-1.c           |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)

diff --git a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c
index bf55b31..5808fed 100644
--- a/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c
+++ b/testcases/open_posix_testsuite/conformance/interfaces/pthread_cond_signal/1-1.c
@@ -134,9 +134,7 @@ int main()
 	alarm(5);
 
 	/* loop to wake up the rest threads */
-	i=0;
-	while (waken_num < THREAD_NUM) {
-		++i;
+	for (i=1; i<THREAD_NUM; i++) {
 		fprintf(stderr,"[Main thread] signals to wake up the next thread\n");
 		if (pthread_cond_signal(&td.cond) != 0) {
 			fprintf(stderr,"Main failed to signal the condition\n");
@@ -145,12 +143,6 @@ int main()
 		usleep(100);
 	}
 
-	if (i >= THREAD_NUM) {
-		fprintf(stderr,"[Main thread] had to signal the condition %i times\n", i+1);
-		fprintf(stderr,"[Main thread] to wake up %i threads\n. Test FAILED.\n", THREAD_NUM);
-		exit(PTS_FAIL);
-	}
-
 	/* join all secondary threads */
 	for (i=0; i<THREAD_NUM; i++) {
 	    	if (pthread_join(thread[i], NULL) != 0) {
-- 
1.7.1


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2012-08-24  2:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23  6:55 [LTP] [PATCH] pthread_cond_signal: don't count pthread_cond_signals Jan Stancek
2012-08-23  8:16 ` Kang Kai
2012-08-24  2:04   ` Wanlong Gao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox