Boost logo

Boost :

From: jsiek_at_[hidden]
Date: 2000-08-11 18:40:03

William Kempf writes:
> class mutex
> {
> public:
> typedef basic_lock<mutex> lock;
> typedef basic_trylock<mutex> trylock;
> typedef basic_timedlock<mutex> timedlock;
> typedef basic_condition<mutex> condition;
> mutex();
> };

I agree that the mutex type needs to be tied to the condition
type, but it doesn't seem right to nest the condition type in the
mutex type. Perhaps the condition class should have a typedef
for the mutex type, and use the explicit lock types in the
implementation of wait(). Or maybe we should have a separate traits

> while (!full)
> lock.wait(cv);

while (!full)

makes a little more sense to me.

I've got a preliminary write up of ConditionVariable with this
interface, incuding the buffer example (which was compiled
and run using KCC and Solaris threads).



Boost list run by bdawes at, gregod at, cpdaniel at, john at