Boost logo

Boost :

From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2003-11-18 08:13:32


Martin Wille wrote:
[...]
> and in the POSIX standard:
>
> No errors are returned from pthread_getspecific().
>
> The pthread_setspecific() function shall fail if:
> [ENOMEM]
> Insufficient memory exists to associate the value with the key.

Why, how outdated (well, almost).

http://www.opengroup.org/austin/mailarchives/austin-review-l/msg01511.html
http://www.opengroup.org/austin/restricted/tc2d5/tc2_d5.1.html

2240 Change Number: XSH/TC2/D5.1/96 [XSH ERN 100]

2241 On Page: 1064 Line: 33451 Section: pthread_getspecific (2003 Ed.)
2242 On Page: 1060 Line: 33279 Section: pthread_getspecific (2001 Ed.)

2243 In the ERRORS Section
2244 Change From:
2245 "[ENOMEM] Insufficient memory exists to associate the value with the key."
  
2246 To:
2247 "[ENOMEM] Insufficient memory exists to associate the non-NULL value
2248 with the key."
  
>
> It seems to me that the result of m_tss.set() should
> be checked and an exception should be thrown in case
> of a failure.

Sure (and p shall be deleted). Ideally, POSIX{.C++} shall provide "native"
reset() and dispose():

http://groups.google.com/groups?selm=3F7C4829.6D2E2F12%40web.de

"extern "C" int ... throw(std::bad_alloc)" (for pthread_setspecific() and
pthread_resetspecific()) is copy&paste leftover/error, of course. It was
meant to be "extern "C" int ... throw()".

regards,
alexander.


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