Boost logo

Boost :

From: Greg Colvin (gcolvin_at_[hidden])
Date: 2001-03-15 12:16:47


Probably we need an exception class specific to Boost.Threads,
whose what() string can be taken from strerror() on Unixen.

From: <williamkempf_at_[hidden]>
--- In boost_at_y..., Eugene Karpachov <jk_at_s...> wrote:
> Thu, Mar 15, 2001 at 04:03:28PM -0000, terekhov_at_y... ÐÉÛÅÔ:
> > > As usual with POSIX, check for -1 as error flag and inspect
errno.
> > You could
> > > throw some exception object containing this errno value.
> > >
> > > --
> > > jk
> >
> > POSIX _threads_ calls do not use errno (-1 as error flag)
> > ZERO return value is used as OK indication, non-zero
> > return value is used as spec. status (error) indication.
>
> Yes, you are right. Must check for !=0; but I insist on errno :)

I will *NOT* throw an exception containing an errno value. Such a
value is not portable (the errnos returned by various thread APIs
will not match) and so will not be useful to programmers. If the
specific type of error that occurred is necessary (I'm not sure it is
in most cases) then we either need to define our own errnos, or
preferrably throw different exceptions (or at least change the what()
text accordingly).


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