Why no pthread_mutexattr_settype()?

Joel Sherrill joel.sherrill at oarcorp.com
Fri Mar 17 15:53:28 UTC 2006

Peter Dufault wrote:

> On Mar 16, 2006, at 9:07 PM, Phil Torre wrote:
>> I am porting some code that wants to use pthread_mutexattr_settype(),
>> and I see that RTEMS (4.6.0 at least) doesn't have one.  I put in a
>> hack to set the recursive field of the newly initialized mutexattr
>> struct to "1", and seem to get proper recursive locking behavior.
>> I see no way to make a POSIX mutex recursive using the normal API.
>> Am I missing it?  Is there no mutexattr_settype() because no one
>> ever needed one?  Or is making a POSIX mutex recursive in RTEMS bad
>> for some reason?  (CORE_mutex_Nesting_behaviors allows for it, so
>> it seems like it should be OK.)
> It's an X/Open and not a POSIX thing, so that's probably why it isn't  
> there.
My research this morning makes me think it wasn't in the original POSIX 
specification but was added as part of the Single Unix Specification.  I 
get the
impression it was part of the 2nd revision.

There is no technical reason it shouldn't be added.  As you noted the 
score supports
the capability.  Prepare a patch adding this and the corresponding get.

> Peter Dufault
> HD Associates, Inc.

More information about the users mailing list