From cbb7919d51425b5dea3aa5189228d3088ca20dfc Mon Sep 17 00:00:00 2001 From: sean Date: Tue, 21 Oct 2008 23:40:18 +0000 Subject: [PATCH] Changed pthread_cleanup to properly account for platform differences. core.thread should now build with freebsd. git-svn-id: http://svn.dsource.org/projects/druntime/trunk@35 4a9d5153-6564-4b3f-b5e1-7e8e9dac548f --- src/common/core/thread.d | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/common/core/thread.d b/src/common/core/thread.d index 7c27bf2..65b8df9 100644 --- a/src/common/core/thread.d +++ b/src/common/core/thread.d @@ -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(); -- 2.43.0