Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-15 08:47:07


----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Tuesday, January 15, 2002 8:35 AM
Subject: Re: [boost] Re: first sight

> From: "terekhov" <terekhov_at_[hidden]>
> <<
> "There are several important blocking routines
> that are specifically not made cancelation points:
> - pthread_mutex_lock()
> >>
>
> I agree that there should exist a non-cancelable mutex_lock() for use in
> destructors, although the default mutex_lock IMHO should be cancelable.

Is mutex_lock so very special in a destructor? Wouldn't it be better just to
have a stack-based cancellation-preventer? There are other threading
functions which can be called (indirectly) during destruction:

A::~A()
{
    disable_cancellation protect;
    cleanup(); // does it call a cancellation-point? Doesn't matter!
}

...or is this really about efficiency?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk