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