Boost logo

Boost :

From: williamkempf_at_[hidden]
Date: 2001-07-19 15:47:05


--- In boost_at_y..., "Alexander Terekhov" <terekhov_at_d...> wrote:
>
> > > which is simply a convenient way to deal with
> > > (acq/rel) LOCKS (mutexes, semaphores,
> > > read/write locks, spinlocks,...).
> >
> > A mutex is not a lock, though.
>
> are you kidding ?

No, I'm not.

> well, fyi..
>
> http://ace.cs.wustl.edu/cvsweb/ace-cvs.cgi/ACE_wrappers/ace/Synch.h?
rev=4.117&content-type=text/x-cvsweb-markup
>
> /**
> * @class ACE_Thread_Mutex_Guard
> *
> * @brief This data structure is meant to be used within a method or
> * function... It performs automatic aquisition and release of
> * an <ACE_Thread_Mutex>.
> *
> * This class is obsolete and should be replaced by
> * ACE_Guard<ACE_Thread_Mutex>.
> */
> class ACE_Export ACE_Thread_Mutex_Guard
> {
> .
> .
> .
> protected:
> /// Reference to the mutex.
> ACE_Thread_Mutex &lock_;
> ^^^^^^ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
>
>
> also, fyi..
>
> http://ace.cs.wustl.edu/cvsweb/ace-
cvs.cgi/ACE_wrappers/ace/Synch_T.h?rev=4.90&content-type=text/x-
cvsweb-markup
>
> /**
> * @class ACE_Guard
> *
> * @brief This data structure is meant to be used within a method or
> * function... It performs automatic aquisition and release of
> * a parameterized synchronization object <ACE_LOCK>.
> ^^^^ !!!!!!!!!!!!!!
> *
> * The <ACE_LOCK> class given as an actual parameter must provide at
> * the very least the <acquire>, <tryacquire>, <release>, and
> * <remove> methods.
> */
> template <class ACE_LOCK>
> class ACE_Guard
> {
> public:
>
> // = Initialization and termination methods.
> ACE_Guard (ACE_LOCK &l);

That only shows that the ACE library has chosen to use this name in
this manner (inconsistently, BTW). It doesn't mean that the choice
was correct. You acquire a lock on a mutex. This means a mutex is
not a lock.

Bill Kempf


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