Boost logo

Boost Users :

From: Dan Dimerman (dimerman_at_[hidden])
Date: 2004-12-06 10:08:17


"Ben Hutchings" <ben.hutchings_at_[hidden]> wrote in message
news:41B47000.1030500_at_businesswebsoftware.com...
> That still won't solve your problem, in general. Multithreading is an /
> ... /
> You should protect all access to the controlling flag with a mutex. In
> this case it would probably be sufficient to use the "volatile" qualifier
> on the controlling member, but this is not generally a good solution.
> Ben.

In this case, I think the problem was that by {mis,ab,}using the boost
thread lib, I passed a copy of
the functor that would be the worker thread instead of just a reference to
it, hence the duplicity.
Protecting that variable with a mutex wouldn't have had any effect, since
there would have been two copies still.
regards...
Dan

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.806 / Virus Database: 548 - Release Date: 05-Dec-04 

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