Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost::mutex] Suspicious EINVAL error
From: Vicente BOTET (vicente.botet_at_[hidden])
Date: 2011-04-03 16:26:24


> Message du 02/04/11 01:59
> De : "Panagiotis Foteinos"

> A : boost-users_at_[hidden]
> Copie à :
> Objet : [Boost-users] [boost::mutex] Suspicious EINVAL error
>
> Hello users.
>
> I am running a single thread which locks and unlocks mutexes, and I get the
> following error: *
>
> /usr/include/boost/thread/pthread/mutex.hpp:55: void
> boost::mutex::lock(): Assertion `!pthread_mutex_lock(&m)' failed,
>
> *after a boost::shared_mutex::lock() or a boost::shared_mutex::try_lock().

> I do realize that the information I provide in this email is little, but I,
> being new in boost::mutexes and having spent so much time on it, decided to
> give it a shot.

Hi,

this kind of error is quite common. It seems that you try to lock the mtx twice. Could you show the error when you have a try_lock? Do you use the RAII locks that ensure that lock/unlock are pairwise?

Best,
Vicente


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