boost threads: pthread mutex priority inheritance

Hi, I just discovered today that pthread mutex's aren't guaranteed to do priority inheritance unless PTHREAD_PRIO_INHERIT is set. I'm doing a bunch of soft-rt work with SCHED_RR so priority inheritance on shared resources is a given necessity. But how should this be worked into boost mutex? There's no way of constructing a boost mutex from an existing object, nor anyway of setting mutex attributes used inside the ctor. There's also no way of manipulating the mutex attributes after pthread_mutex_init. For the moment, the few lines that compose the mutex class are easily copied so that I can do my own business inside the constructor but I expect others will run into this problem down the line and this solution is a bit unsavory. Any better advice?

On Wed, Jul 27, 2011 at 4:48 PM, Jason Newton <nevion@gmail.com> wrote:
For the moment, the few lines that compose the mutex class are easily copied so that I can do my own business inside the constructor but I expect others will run into this problem down the line and this solution is a bit unsavory. Any better advice?
Actually a private copy of mutex didn't work so well overall as pthread conditions are hard coded to void boost::condition_variable::wait(boost::unique_lock<boost::mutex>&) -Jason
participants (1)
-
Jason Newton