Boost logo

Boost Users :

From: Bill Somerville (bill_at_[hidden])
Date: 2008-04-24 19:02:44


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 list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net