
Hi, I have been converting some of my pthread-code to boost::thread, and I commonly use thread-specific storage to store a pointer that is not intended to be deleted when the thread exits (the default action for thread_specific_ptr). In pthreads, specifying NULL as the cleanup_function accomplishes what I want, i.e. no cleanup is done. In boost::thread, specifying NULL will crash my program, because the implementation does not test for a null cleanup_function before invoking it. Since the cleanup function for thread_specific_ptr<T> takes an argument of type T*, this means that whereever I use thread_specific_ptr in this way, I have to define an empty function taking T*, to pass as the cleanup function. It seems pretty messy and wasteful to me, when all that is needed is a (cleanup_function != 0) test in the implementation. Is there a rationale for boost::thread not supporting a NULL cleanup_function pointer? Thanks, -bryan