]> git.llucax.com Git - software/druntime.git/commitdiff
Changed pthread_cleanup to properly account for platform differences. core.thread...
authorsean <sean@4a9d5153-6564-4b3f-b5e1-7e8e9dac548f>
Tue, 21 Oct 2008 23:40:18 +0000 (23:40 +0000)
committersean <sean@4a9d5153-6564-4b3f-b5e1-7e8e9dac548f>
Tue, 21 Oct 2008 23:40:18 +0000 (23:40 +0000)
git-svn-id: http://svn.dsource.org/projects/druntime/trunk@35 4a9d5153-6564-4b3f-b5e1-7e8e9dac548f

src/common/core/thread.d

index 7c27bf2004019af3f3aed6f096f18f3797eb5c77..65b8df9cf97c7e02032872440edd25daada493fe 100644 (file)
@@ -199,8 +199,20 @@ else version( Posix )
             //       implementation actually requires default initialization
             //       then pthread_cleanup should be restructured to maintain
             //       the current lack of a link dependency.
+            version( linux )
+            {
+                pthread_cleanup cleanup = void;
+                cleanup.push( &thread_cleanupHandler, cast(void*) obj );
+            }
+            else version( darwin )
+            {
             pthread_cleanup cleanup = void;
             cleanup.push( &thread_cleanupHandler, cast(void*) obj );
+            }
+            else
+            {
+                pthread_cleanup_push( &thread_cleanupHandler, cast(void*) obj );
+            }
 
             // NOTE: For some reason this does not always work for threads.
             //obj.m_main.bstack = getStackBottom();