-
-
Notifications
You must be signed in to change notification settings - Fork 426
[dmd-cxx] Fix Issue 19481: mutex.d(95) Error: pthread_mutex_init failed #2534
Conversation
Thanks for your pull request, @ibuclaw! Bugzilla references
Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "dmd-cxx + druntime#2534" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe mutexAlign
could be a property of Mutex itself so explicit alignment could be used by overwriting mutexAlign
with a constant.
There's nothing wrong with the alignment of Mutex. If you're lucky, it's the size of N in void[N][2] that's the issue, as only the first index is suitably aligned. (You're unlucky if the alignment of pointers is smaller than the alignment of the OS mutex type). There is no one constant alignment either, what type of and what alignment of the mutex is varies between platforms. |
Committing, if an amendment is needed before May, then so be it. |
libphobos: Fix abort in pthread_mutex_init on Solaris. Merges upstream druntime d57fa1ff. Reviewed-on: dlang/druntime#2534 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@270057 138bc75d-0d04-0410-961f-82ee72b054a4
Mutex.alignof might be unusable here because it is the alignment of the class reference (the unlucky case):
Agreed, the aligned size of the object is another issue.
I meant something like
so this declaration doesn't have to be repeated everytime something similar is done. But probably the better solution would be for |
Yes, you can't use Mutex.alignof, which why it is being changed from. The underlying record is suitably aligned, hence I re-iterate there is no problem with Mutex (i.e: when used as
I don't see a reason for that, as you almost certainly mean OS_mutex_type.alignof (Currently: I had considered something similar to core.sync.semaphore.
But ultimately went for this instead over |
Committing the backport before it's in master... should give you a couple months to fix failing mecca in #2411 before gdc switches to ddmd/master when stage1 opens for gcc-10.