Boost C++ Libraries: Ticket #1260: Thread-safety problem in Boost.Function https://svn.boost.org/trac10/ticket/1260 <p> From Sean Huang, on the Boost mailing list: </p> <p> The following code in function_template.hpp has me concerned: </p> <blockquote> <p> template&lt;typename Functor&gt; void assign_to(Functor f) { </p> <blockquote> <p> static vtable_type stored_vtable(f); if (stored_vtable.assign_to(f, functor)) vtable = &amp;stored_vtable; else vtable = 0; </p> </blockquote> <p> } </p> </blockquote> <p> The function scope statics are not thread-safe as far as I know and this is potentially a show stopper for us (we're in the process of upgrading from 1.33.1 to 1.34+. Same usage in boost.serialization caused our application (very heavy threaded) to crash. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1260 Trac 1.4.3 Douglas Gregor Thu, 13 Sep 2007 17:38:59 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1260#comment:1 https://svn.boost.org/trac10/ticket/1260#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/39240" title="function/function_base.hpp, function/function_template.hpp: - Switch ...">[39240]</a>) function/function_base.hpp, function/function_template.hpp: </p> <ul><li>Switch from dynamic initialization of the vtable pointer to static initialization (Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/1260" title="#1260: Bugs: Thread-safety problem in Boost.Function (closed: fixed)">#1260</a>) </li><li>Handle member pointers properly, only using mem_fn within the invoker to deal with all of the messy bits of calling member pointers </li></ul> Ticket alex_basakov@… Fri, 21 Dec 2007 12:02:26 GMT <link>https://svn.boost.org/trac10/ticket/1260#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1260#comment:2</guid> <description> <p> Can't build 1.34.1 program_options library with newly provided function_base.hpp, function_template.hpp. MSVC 8.0 SP1. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Douglas Gregor</dc:creator> <pubDate>Fri, 21 Dec 2007 15:13:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1260#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1260#comment:3</guid> <description> <p> There is yet another updated function_base.hpp on the main Boost web site. This takes care of the problem for real. </p> </description> <category>Ticket</category> </item> <item> <author>baf11@…</author> <pubDate>Mon, 24 Dec 2007 14:55:23 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/1260#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/1260#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/1260#comment:3" title="Comment 3">dgregor</a>: </p> <blockquote class="citation"> <p> There is yet another updated function_base.hpp on the main Boost web site. This takes care of the problem for real. </p> </blockquote> <p> Just wanted to point out the main boost website has a typo -&gt; s/cricial/critical/. </p> </description> <category>Ticket</category> </item> </channel> </rss>