Boost logo

Boost :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2004-06-29 09:57:40


On Tuesday 29 June 2004 9:15 am, Michael Glassford wrote:
> > For that purpose we'll need something like
> >
> > scoped_lock(mutex&, nolock_t);
>
> I'm increasingly liking this syntax, by the way; thanks for suggesting it.

I don't know the original intention, but my assumption about the "bool"
parameter was that it was intended to be used to check (run-time) conditions
that might eliminate the need for locking under certain circumstances, e.g.,

bool foo(bool threadsafe)
{
  mutex::scoped_lock l(m, !threadsafe);
}

Using types such as nolock_t would prevent such a usage.

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk