Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2006-11-01 17:26:25

On Nov 1, 2006, at 4:49 PM, Roland Schwarz wrote:

> I might miss the point. But the problem is not only how to emulate
> a recursive mutex, in case the operating system does not allow
> recursive locking, but how to expose these two kinds if they
> exist on the opsys API level. If they exist I'd rather use them,
> instead letting the library emulate. No?


template <>
class recursive_mutex<native-type>
     native_type mut_;
     void lock() {mut_.lock();} // or whatever straight drop through
to the OS

And yet you can still say recursive_mutex<upgradable_mutex> and get
the (more expensive) emulation.

This is just exactly how and why I want to template condition as well:

template <class Lock>
class condition

template <>
class condition<native-type>
     ... straight drop through to native-condition of native-mutex


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