$include_dir="/home/hyper-archives/threads-devel/include"; include("$include_dir/msg-header.inc") ?>
From: Constantine Sapuntzakis (csapuntz_at_[hidden])
Date: 2008-01-30 19:42:36
I suggest that scoped_lock::release be either renamed or be hidden from
easy use. I spent about 45 minutes tracking down a bug in my code where
I used scoped_lock::release instead of scoped_lock::unlock.
The mistake was due to my experience with other libraries. For example,
java's concurrency library uses release() instead of unlock(). Win32 API
is called ReleaseMutex. More generally, the terminology acquire/release
is often used with synchronization constructs.
The current semantics of scoped_lock::release() are consistent with
auto_ptr and other C++ idioms. But I think they may still suprise users.
-Costa