Boost logo

Boost Users :

Subject: Re: [Boost-users] Assertion in boost::mutex
From: Matthew L. Creech (mlcreech_at_[hidden])
Date: 2008-10-03 16:37:32


On Fri, Oct 3, 2008 at 3:50 PM, amit khandelwal
<khandelwal.amit_at_[hidden]> wrote:
> I am getting an assertion in boost::mutex while using static mutex
> variables. Below is the stack trace for that.
>
> void boost::mutex::lock(): Assertion `!pthread_mutex_lock(&m)' failed.
>

Was the assertion failure for pthread_mutex_lock(), or
pthread_mutex_destroy()? Your assertion message has the former, but
the back-trace indicates the latter.

Either way, the cause might be static initialization order. Do you
have a global object whose destructor makes use (directly, or
indirectly through any contained classes' destructors) of a mutex
which is also part of some global object?

-- 
Matthew L. Creech

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