
29 Jun
2004
29 Jun
'04
2:57 p.m.
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