Email List: Xaustin-review-lX
[All Lists]

Defect in XSH pthread_mutex_setprioceiling()

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH pthread_mutex_setprioceiling()
From: yyy@xxxxxxxxx
Date: Thu, 23 Oct 2003 16:05:08 +0100 (BST)
        Defect report from : Michael Gonzalez (on behalf of IEEE PASC SSWG-RT) 
, Universidad de Cantabria

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 1081 line 34018-34020 section pthread_mutex_setprioceiling() objection 
{2}

Problem:

Edition of Specification (Year): 2003

Defect code :  2. Omission

The POSIX.1 specification for pthread_mutex_setprioceiling() states:

   "The pthread_mutex_setprioceiling( ) function shall either lock the
   mutex if it is unlocked, or block until it can successfully lock
   the mutex, then it shall change the mutex’s priority ceiling and
   release the mutex."

The problem is that it is not clear what happens if mutex is already
locked by the calling thread. POSIX.1 states that calling
pthread_mutex_lock() is an error if the mutex is already locked by the
calling thread, and specifies an error condition for that situation
(EDEADLK). But it doesn't say anything for
pthread_mutex_setprioceiling(); no error condition is specified for
this case.

Furthermore, some ceiling-change protocols require the mutex to be
locked before the pthread_mutex_setprioceiling() operation can be
invoked, to atomically change the ceiling and some of the state
protected by the mutex.

Action:

Add the following sentence at the end of the text quoted above:

   "If the mutex is already locked by the calling thread, the function
   shall change the mutex's priority ceiling and leave the mutex
   locked."

Alternatively, if there are backwards compatibility issues that
preclude this solution, an alternate solution would be to define a new
interface for dynamically changing the mutex's ceiling while the
calling thread holds the lock on the mutex.

<Prev in Thread] Current Thread [Next in Thread>
  • Defect in XSH pthread_mutex_setprioceiling(), mgh <=