recursive mutex?

Carlo Wood carlo@alinoe.com
Thu Oct 18 09:39:00 GMT 2001


On Wed, Oct 17, 2001 at 08:39:51PM -0500, Loren James Rittle wrote:
> According to the POSIX standard, the recursive mutex is an option.
> 
> The gthr.h abstraction layer, which STL/libstdc++ uses, does not offer
> a recursive mutex.

In order to implement a recursive mutex, I will have to compare
the thread-id with a stored version of itself.  However, I also
do not see support for a `pthread_self' and `pthread_equal' either.

Does this mean I can not add a recursive mutex to libstdc++ without
using Thread Specific Data?  I'd rather solve it differently because
it seems to me that getspecific is rather slow.

-- 
Carlo Wood <carlo@alinoe.com>



More information about the Libstdc++ mailing list