Boost logo

Boost Users :

Subject: Re: [Boost-users] Assertion `!pthread_mutex_destroy(&m)' failed
From: nmittal (nmittal_at_[hidden])
Date: 2009-06-24 16:54:40


thanks. Could you point me to a better way for handling signals.

thanks
Nishant

Zeljko Vrba wrote:
>
> On Tue, Jun 23, 2009 at 10:14:33AM -0700, nmittal wrote:
>>
>> void ctrl_c_handler(int sig) {
>> cout << "Received SIGTERM" << endl;
>>
>
> This line by itself is enough to cause undefined behavior. There is very
> little that you can do from a signal handler; accessing global objects
> such
> as cout is a VERY bad idea.
>
>>
>> the program works fine and responds to messages. however I get the
>> following
>> error when i press CTRL-C
>>
>> mysql_dealer:
>> /usr/local/include/boost-1_39/boost/thread/pthread/mutex.hpp:45:
>> boost::mutex::~mutex(): Assertion `!pthread_mutex_destroy(&m)' failed.
>>
>> any help would be much appreciated.
>>
> What most probably happens is that the destructor is attempting to destroy
> the mutex while it is held locked by another thread. You will need to
> devise
> a better shutdown strategy.
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>

-- 
View this message in context: http://www.nabble.com/Assertion-%60%21pthread_mutex_destroy%28-m%29%27-failed-tp24167949p24192738.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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