Subject: [Boost-bugs] [Boost C++ Libraries] #1958: thread_specific_ptr lacks support for NULL cleanup function
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-05-27 18:53:05
#1958: thread_specific_ptr lacks support for NULL cleanup function
------------------------------------------------------+---------------------
Reporter: Bryan Green <bryan.d.green_at_[hidden]> | Owner: anthonyw
Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: thread
Version: Boost Development Trunk | Severity: Problem
Keywords: cleanup_function tss thread_specific_ptr |
------------------------------------------------------+---------------------
Passing a null pointer as the cleanup_function argument to the
thread_specific_ptr constructor
leads to a null dereference and a program crash.
Use of a null cleanup function is well defined in the pthread API: it
means that no cleanup is to
be performed. Boost::Thread currently lacks this mode, requiring the
programmer to define a specialized empty function any time a
thread_specific_ptr is created where no cleanup is desired.
I'm filing this as a bug, since it represents a common practice, well
supported and documented in the pthread API, which in boost leads to a
program crash.
I'm attaching a patch representing a potential implementation of NULL-
cleanup-function support.
--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1958>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC