> // In library Foo > > void some_library_foo() > { > boost::thread_specific_ptr<Foo> p; > // other stuff > } > > // In Application Bar which uses library Foo with out any knowledge > // that Foo used Boost.Threads > void bar() > { > some_library_foo(); > } > > int main() > { > __beginthread(&bar, ....); // leak, but how could the developer know? > } >
I'm not sure I understand this example completely. Is this the case where library Foo's author has created the some_library_foo function with the intention that it will be accessed by a thread, but leave the actual thread creation up to the user of the foo library (the bar application in your example)? If this is correct, it seems like Foo should either a) not burden Bar with the knowledge that threads are being used and handle thread creation itself or b) allocate locally to some_library_foo without using thread_specific_ptr. William, thank you for taking the time to answer these questions so promptly, I appreciate your help! Also, if it would be beneficial to take this discussion offline, I am open to that as well. David _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost