Amit is right: boost::mutex::scoped_lock
is a typedef
for boost::unique_lock<boost::mutex>
, not lock_guard
. scoped_lock
is not available in C++0x.
Unless you need the flexibility of unique_lock
, I would use lock_guard
. It is simpler, and more clearly expresses the intent to limit the lock to a defined scope.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…