Using threads on Mac OS X using D1 and Tango

Jacob Carlborg doob at me.com
Wed Dec 18 05:16:49 PST 2013


On 2013-12-15 16:28, Jacob Carlborg wrote:
> I'm trying to use threads on Mac OS X using D1 and Tango. I have this
> very simple example:
>
> import tango.core.Thread;
>
> void main ()
> {
>      Thread thread = new Thread({ });
>      thread.start();
>      thread.join();
> }
>
> I'm using DMD 1.076 to compile the above example on Mac OS X 10.8.5 as
> 32bit. When I run that example I get a segmentation fault. The example
> works fine on Linux.

If anyone is interested I found the problem. I added the following code:

version( linux )
{
     cleanup.pop( 0 );
}
else version( darwin )
{
     cleanup.pop( 0 );
}
else version( solaris )
{
     cleanup.pop( 0 );
}
else
{
     pthread_cleanup_pop( 0 );
}

Here:

http://www.dsource.org/projects/tango/browser/trunk/tango/core/Thread.d#L275

-- 
/Jacob Carlborg


More information about the Digitalmars-d-learn mailing list