Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Conversation

schveiguy
Copy link
Member

This adds an initializer to pthread_mutex_t so it is correct by default on OSX. Not sure if this will work, it failed my unittest build on OSX with a link error. I think possibly types.d is not included in the unit test build.

@MartinNowak
Copy link
Member

Don't think you want that initializer for the type itself, but only for PTHREAD_MUTEX_INITIALIZER.

@andralex
Copy link
Member

@MartinNowak why not? Then PTHREAD_MUTEX_INITIALIZER is simply pthread_mutex_t.init. In fact that's exactly what happens on Linux - zero-initialization just works.

@schveiguy
Copy link
Member Author

Updated to only change pthread.d definition. I also added PTHREAD_ONCE_INIT since it was right there. I don't know about the others.

@MartinNowak
Copy link
Member

@MartinNowak why not?

Because it's a bad idea to deviate from the documented and standardized C behavior in a simple C header.

@MartinNowak
Copy link
Member

Auto-merge toggled on

MartinNowak added a commit that referenced this pull request May 25, 2015
Fix issue 14617 - PTHREAD_MUTEX_INITIALIZER does not work on OSX
@MartinNowak MartinNowak merged commit 19f3f0d into dlang:master May 25, 2015
@schveiguy
Copy link
Member Author

The standard behavior is to fill with random data. We don't do that either ;)

@schveiguy schveiguy deleted the pthreadmutexosx branch May 25, 2015 19:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants