|
Boost : |
Subject: Re: [boost] [Interprocess::Semaphore] Deadlock on more producers - one consumer problem
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2009-06-20 15:39:51
Cosimo Calabrese wrote:
> inline void interprocess_semaphore::post()
> {
> scoped_lock<interprocess_mutex> lock(m_mut);
> if(m_count == 0){
> m_cond.notify_one();
> }
> ++m_count;
> }
Yes, I think you are right. post() should unconditionally notify_one(),
otherwise, we could post() several times and only wake up one thread.
Can you test your code removing the m_count == 0 condition?
Thanks,
Ion
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk