|
Boost : |
From: Batov, Vladimir (Vladimir.Batov_at_[hidden])
Date: 2004-07-21 18:16:27
Howard,
Thank you for taking on the task of shaping up the interface. That
activity is of great importance. A few comments.
explicit scoped_lock(mutex_type& m);
scoped_lock(mutex_type& m, detail::defer_lock_type);
scoped_lock(mutex_type& m, detail::try_lock_type);
scoped_lock(mutex_type& m, const elapsed_time& elps_time);
The problem (as I can see it) with the set above is that "deferred",
"tried" and "timed" appear to be alternatives or mutually exclusive.
However, "deferred" and, say, "try" functionalities are orthogonal. That
is, as one might need to defer a blocking lock
scoped_lock l(m, deferred);
one might need a deferred try_lock as well. Therefore, as we are trying
to provide one universal lock, it appears we have to have something
complex like
basic_lock(mutex_type&, const elapsed_time&, defer_type);
that would address all the lock variability/configurability. Such a
basic lock would not be for general consumption but rather the basis for
something like:
try_lock : private (?) basic_lock
{ ...
try_lock(mutex_type& m, deferred d) : basic_lock(m, 0, d) {}
}
Best,
V.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk