From: Kang Kai <Kai.Kang@windriver.com>
To: ltp-list@lists.sourceforge.net
Subject: Re: [LTP] [PATCH] pthread_cond_signal: don't count pthread_cond_signals
Date: Thu, 23 Aug 2012 16:16:47 +0800 [thread overview]
Message-ID: <5035E6EF.2060808@windriver.com> (raw)
In-Reply-To: <0b20ceed0020e979ec36629e552f77acf96467cc.1345704746.git.jstancek@redhat.com>
On 2012年08月23日 14:55, Jan Stancek wrote:
> 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>
Signed-off-by: Kang Kai <kai.kang@windriver.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) {
------------------------------------------------------------------------------
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
next prev parent reply other threads:[~2012-08-23 8:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2012-08-24 2:04 ` Wanlong Gao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5035E6EF.2060808@windriver.com \
--to=kai.kang@windriver.com \
--cc=ltp-list@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox