Boost logo

Boost Users :

Subject: [Boost-users] boost::mutex::scoped_lock fails with res = 22 (EINVAL)
From: Andrej van der Zee (andrejvanderzee_at_[hidden])
Date: 2011-08-25 08:34:13


Hi,

I am trying to understand why the acquiring of a lock fails on error
code 22 (EINVAL). After Googling I find one of two causes:

1) The mutex was created with the protocol attribute having the value
PTHREAD_PRIO_PROTECT and the calling thread's priority is higher than
the mutex's current priority ceiling. The mutex is created by the
main-thread and the lock is acquired by a thread from a
boost::thread_group. But in many cases the lock is acquired without
error, so I guess this is not the cause.
2) The value specified by mutex does not refer to an initialized mutex
object. The mutex is default constructed by boost::mutex's constructor
so I expect it to be initialized properly.

Both causes *seem* not to apply to my case. What am I missing here? I
am using boost 1.46.1 on Ubuntu amd64.

Cheers,
Andrej


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net