[haiku-bugs] [Haiku] #16709: THR: Test FAILED - conformance/interfaces/pthread_rwlock_rdlock/2-3.test

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 29 Dec 2020 04:43:40 -0000

#16709: THR: Test FAILED - conformance/interfaces/pthread_rwlock_rdlock/2-3.test
-------------------------------------------------+-------------------------
 Reporter:  cocobean                             |       Owner:  nobody
     Type:  bug                                  |      Status:  new
 Priority:  normal                               |   Milestone:
                                                 |  Unscheduled
Component:  System/POSIX                         |     Version:
 Keywords:  POSIX, pthreads,                     |  R1/Development
  pthread_rwlock_rdlock                          |  Blocked By:
 Blocking:                                       |    Platform:  All
-------------------------------------------------+-------------------------
 Test that pthread_rwlock_rdlock(pthread_rwlock_t *rwlock)

 If the Thread Execution Scheduling option is supported, and the threads
 involved in the lock are executing with the scheduling policies SCHED_FIFO
 or SCHED_RR, the calling thread shall not acquire the lock if a writer
 holds the lock or if writers of higher or equal priority are blocked on
 the lock;  otherwise, the calling thread shall acquire the lock.

 In this case, reader has higher priority than the writer

 Steps:
 We have three threads, main(also a reader), writer, reader
 {{{
 1.  Main thread set its shcedule policy as "SCHED_FIFO", with highest
 priority the three: sched_get_priority_min()+2.
 2.  Main thread read lock 'rwlock'
 3.  Create a writer thread, with schedule policy as "SCHED_FIFO", and
 priority using sched_get_priority_min().
 4.  The thread write lock 'rwlock', should block.
 5.  Main thread create a reader thread, with schedule policy as
 "SCHED_FIFO", and priority sched_get_priority_min()+1
 6.  Reader thread read lock 'rwlock', shouldn't block, since it has a
 higher priority than the writer blocked on 'rwlock'
 7.  Main thread release the 'rwlock', the writer should get the lock
 first.

 }}}


 NOTE: The test result is UNSUPPORTED if Thread Execution Scheduling option
 is not supported.


 Ref:
 
https://github.com/haiku/open_posix_testsuite/blob/from_haiku_trunk/conformance/interfaces/pthread_rwlock_rdlock/2-3.c

 Expected result: Test passed

 Actual Result: Test failed. rd_thread blocked on read lock

 Tested on: Haiku hrev54815 x86 with Open POSIX Test Suite 1.5.2
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/16709>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: