|
Boost Users : |
Subject: Re: [Boost-users] Need advice on std::queue syncronization using boost::mutex - maybe a bug in pthread?
From: Ilya Kalujny (kalujny_at_[hidden])
Date: 2008-12-13 03:57:01
Thank you kindly!
2008/12/12 Steven Watanabe <watanabesj_at_[hidden]>
> AMDG
>
> Ilya Kalujny wrote:
>
>> I`d like to ask for your kind advice regarding boost::mutex behaviour.
>>
>> I dont see what i`m doing wrong here. The issue is that at some point a
>> mutex used to syncronize access to std::queue becomes locked on it's own,
>> despite being explicitly unlocked before. I can repeat this more or less
>> consistently. I triple checked the logic behind code and it seems correct to
>> me.
>>
>
> The thread that unlocks a mutex must be the same one that locked it.
> You really ought to use a condition variable.
>
> In Christ.
> Steven Watanabe
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
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