Ingo Molnar wrote: >* david singleton wrote: > > > >>>both rt_mutex_free() and rt_mutex_set_owner() must be called with the >>>proper locking. David? >>> >>> >> Yes, the lock needs to be protected by the robust semaphore. >> The locking order is: >> >> mmap_sem to protect the vma that holds the pthread_mutex >> >> robust_sem to protect the futex_mutex chain. >> >> futex_mutex - the rt_mutex associated with the >>pthread_mutex. >> >> > >well, also lock->wait_lock and lock->pi_lock. The act of making another >thread the owner of this particular mutex must be performed carefully. >Check out rt.c to see what locking dependencies there are. (We can also >do a lockless cmpxchg for unlocked mutexes, under certain > > Ingo, here is a patch that provides the correct locking for the rt_mutex backing the robust pthread_mutex. The patch also unifies the locking for all the robust functions and adds support for pthread_mutexes on the heap. David >circumstances.) > > Ingo > >