On 08/12/2011 07:59 PM, Cyril Hrubis wrote:
> Hi!
>>
>> If with no sleep, child_3 will preempt and get the lock before child_2
>> some time. It may fail the test case.
>>
>> Signed-off-by: Wanlong Gao<[email protected]>
>> ---
>>   .../conformance/interfaces/sem_post/8-1.c          |    3 ++-
>>   1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git 
>> a/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c 
>> b/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c
>> index 165b094..37ed8a3 100644
>> --- a/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c
>> +++ b/testcases/open_posix_testsuite/conformance/interfaces/sem_post/8-1.c
>> @@ -174,6 +174,7 @@ int main()
>>      }
>>      fprintf(stderr, "P: child_2: %d forked\n", c_2);
>>
>> +    sleep(1);
>>      /* Make sure the two children has been waiting */
>>      /*do {
>>              sleep(1);
>> @@ -254,4 +255,4 @@ clean_up:
>>      sem_unlink(semname);
>>      sem_unlink(semname_1);
>>      return retval;
>> -}
>> \ No newline at end of file
>
> While this makes the probability of preempting smaller, the test still
> would fail under some cirscumstances. The correct solution would be
> check the semafore for number of waiting processes. And the code is
> allready there but was commented out some time ago and I wonder why...
It's introduced by commit f102fd9735f01b4e2c9ae44f3c90d1a56d4d81f8
Author: Rishikesh K Rajak <[email protected]>
Date:   Tue Mar 23 14:20:36 2010 +0530

But now it seems not working fine....

-- 
Thanks
Wanlong Gao

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to