Thanks, Bill.
I can declare a mutex but it doesn't have the lock/unlock methods described in the documentation-- the only thing that's public is the constructor/destructor. Could I have botched my installation of boost somehow? I just got it out of synaptic, thinking that that would be the least error-prone way to go.
Also, in the interest of all that "teach a man to fish" stuff so I can quit bothering you, is there a document somewhere that explains what a "concept" is in boost terms? (ie, is it a design specification for developers to work off of, or is it a pure virtual class actually described in a .hpp file somewhere?)
Thanks,
Henry

----- Original Message ----
From: Bill Somerville <bill@classdesign.com>
To: boost-users@lists.boost.org
Sent: Thursday, April 24, 2008 4:02:44 PM
Subject: Re: [Boost-users] Newbie question-- how do I get a Lockable?

Hi Henry,

Henry Holmes wrote:
> Sorry if this is a dumb question-- it looks like just about every kind
> of lock/mutex I could declare in the documentation wants to be passed
> a Lockable object, but I can find no such thing in any of the header
> files. I have the Boost Thread library installed and am able to make
> and run threads, and I have all sorts of other lock and mutex stuff
> defined, it just does not seem to correspond to the documentation at
> all. Am I just horribly confused about what the documentation means?
> Any help is greatly appreciated.
Lockable is not a type, it is a concept. Concepts are requirements a
type must comply with to be used by a type or function. The Lockable
concept is defined here
http://www.boost.org/doc/libs/1_35_0/doc/html/thread/synchronization.html#thread.synchronization.mutex_concepts
. The boost thread library provides types that implement these concepts
and they may be substitued where a suitable concept is required. This is
a form of polymorphism you may not be aware of. The types you may want
to instantiate for your requirements are probably described here
http://www.boost.org/doc/libs/1_35_0/doc/html/thread/synchronization.html#thread.synchronization.mutex_types
note that they all implement at least the Locakble concept.

HTH

--
Bill Somerville
Class Design Limited

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users



Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.