On 07/26/2013 03:07 PM, Jan Stancek wrote:
>
>
> ----- Original Message -----
>> From: "Wanlong Gao" <[email protected]>
>> To: "LTP" <[email protected]>
>> Cc: "Cyril Hrubis" <[email protected]>, "Caspar Zhang"
>> <[email protected]>, "Garrett Cooper" <[email protected]>,
>> "Mike Frysinger" <[email protected]>, [email protected], "Wanlong Gao"
>> <[email protected]>
>> Sent: Friday, 26 July, 2013 4:56:18 AM
>> Subject: [PATCH 1/3] pthread_rwlock_rdlock:2-1: do not test on glibc
>>
>> Since the reader can always acquire the rwlock if there's not a writer
>> held the lock.
>>
>> Signed-off-by: Wanlong Gao <[email protected]>
>
> Hi,
>
> I agree that these 3 fail by default on glibc at the moment.
> Since we are adding a GLIBC ifdef, I'm wondering if we could use
> glibc specific api to change default behaviour with
> pthread_rwlockattr_setkind_np() and still run the testcase.
The first 2 *_rdlock cases can change to WRITER_PREFER to let them pass,
but the last *_unlock one can't, because *_unlock will choose the writer
first without any care of the NP KIND.
How about change the first two cases to WRITER_PREFER and just skip the third
*_unlock one?
Thanks,
Wanlong Gao
>
> Regards,
> Jan
>
>> ---
>> .../conformance/interfaces/pthread_rwlock_rdlock/2-1.c | 6
>> ++++++
>> 1 file changed, 6 insertions(+)
>>
>> diff --git
>> a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c
>> b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c
>> index c6c1412..62a4b3b 100644
>> ---
>> a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c
>> +++
>> b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c
>> @@ -141,6 +141,12 @@ int main(void)
>> return PTS_UNSUPPORTED;
>> #endif
>>
>> +#ifdef __GLIBC__
>> + printf("The reader can always acquire rwlock if there's"
>> + " not a writer held this lock in glibc\n");
>> + return PTS_UNTESTED;
>> +#endif
>> +
>> int cnt = 0;
>> pthread_t rd_thread, wr_thread;
>> int priority;
>> --
>> 1.8.3.3.754.g9c3c367
>>
>>
>
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list