Boost C++ Libraries: Ticket #133: thread_cleanup problems https://svn.boost.org/trac10/ticket/133 <pre class="wiki">Compiling for as a library using CodeWarrior 8.3 running MacOS 9.2.2, many compile-time errors with "thread_cleanup.cpp". The modifications shown below get rid of the compile-time errors (indicated by //eg), but I'm not sure if they are the right way to handle things. // Copyright (C) 2001 // Mac Murrett // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, // provided that the above copyright notice appear in all copies and // that both that copyright notice and this permission notice appear // in supporting documentation. Mac Murrett makes no representations // about the suitability of this software for any purpose. It is // provided "as is" without express or implied warranty. // // See http://www.boost.org for most recent version including documentation. #include "thread_cleanup.hpp" #include &lt;Multiprocessing.h&gt; //eg #include &lt;cassert&gt; //eg namespace boost { namespace threads { namespace mac { namespace detail { namespace { TaskStorageIndex g_ulIndex(0UL); } // anonymous namespace void do_thread_startup() { if(g_ulIndex == 0UL) { OSStatus lStatus = MPAllocateTaskStorageIndex(&amp;g_ulIndex); assert(lStatus == noErr); } set_thread_cleanup_task(NULL); } void do_thread_cleanup() { //eg void (*pfnTask)() = MPGetTaskValue(g_ulIndex); //eg New function name shown in Multiprocessing API version 2.4 void (*pfnTask)() = (void (*)()) MPGetTaskStorageValue(g_ulIndex); //eg } void set_thread_cleanup_task(void (*pfnTask)()) { //eg lStatus = MPSetTaskValue(g_ulIndex, reinterpret_cast&lt;TaskStorageValue&gt;(pfnTask)); OSStatus lStatus = MPSetTaskStorageValue(g_ulIndex, reinterpret_cast&lt;TaskStorageValue&gt;(pfnTask)); //eg assert(lStatus == noErr); } } // namespace detail } // namespace mac } // namespace threads } // namespace boost </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/133 Trac 1.4.3 nobody Thu, 19 Jan 2006 17:21:46 GMT <link>https://svn.boost.org/trac10/ticket/133#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/133#comment:1</guid> <description> <pre class="wiki">Logged In: NO It should be noted that nothing has changed in this regard in boost 1.33.1. In fact, it seems even more parts of Mac Carbon thread support in boost are now completely broken. It would be nice if it either be removed or fixed, the current state is just frustrating. I.e. the above mentioned errors are *syntax* erros (i.e. in do_thread_cleanup) resulting from plain wrong Carbon API function names, missing (!!!) local variables, illegal casts, and so on. Clearly the code can never have compiled this way before. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Roland Schwarz</dc:creator> <pubDate>Thu, 13 Apr 2006 16:58:53 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/133#comment:2 https://svn.boost.org/trac10/ticket/133#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=541730 This bug is beeing closed, since support for MPTasks is beeing dropped. Users are encouraged to use boost.thread on pthreads, which is available on the newer platforms. </pre> Ticket