Project

General

Profile

Bug #1123

pthread_rwlock: wrong order on acquiring lock

Added by Dmitry Moskalchuk almost 4 years ago. Updated over 3 years ago.

Status:
Open
Priority:
Normal
Category:
libcrystax
Target version:
-
Start date:
11/09/2015
Due date:
% Done:

0%

Estimated time:
CPU Architecture:
Host OS:
Toolchain:
Android version:
CrystaX Version:

Description

Use case:

  • Main thread set its shcedule policy as "SCHED_FIFO", with highest priority: sched_get_priority_min()+3.
  • Main thread write lock 'rwlock'
  • Create a writer1 thread, with schedule policy as "SCHED_FIFO", and priority using sched_get_priority_min()+2. The writer should block.
  • Create reader thread, with same priority as writer1. The reader should also block.
  • Create a writer2 thread, with priority sched_get_priority_min(). It should block on write lock too.
  • Main thread release the 'rwlock'

Expected order of lock:

  1. writer1
  2. reader
  3. writer2

Actual order:

  1. writer1
  2. writer2
  3. reader

History

#1

Updated by Dmitry Moskalchuk almost 4 years ago

Here is corresponding test case

#2

Updated by Dmitry Moskalchuk over 3 years ago

  • Description updated (diff)
  • CrystaX Version set to 10.3.1

Also available in: Atom PDF