-
-
Notifications
You must be signed in to change notification settings - Fork 411
Last tweaks for Android #1851
Last tweaks for Android #1851
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1972,6 +1972,10 @@ extern (C) void thread_init() | |
| // functions to detect the condition and return immediately. | ||
|
|
||
| Thread.initLocks(); | ||
| // The Android VM runtime intercepts SIGUSR1 and apparently doesn't allow | ||
| // its signal handler to run, so swap the two signals on Android, since | ||
| // thread_resumeHandler does nothing. | ||
| version( Android ) thread_setGCSignals(SIGUSR2, SIGUSR1); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Android VM runtime intercepts When the unit tests for I've been using Ilya's #1565 also, which works fine. However, that pull has been stuck in limbo for more than a year, so I'd like to get this in in the meantime. Whenever that pull is approved, this can be removed. |
||
|
|
||
| version( Darwin ) | ||
| { | ||
|
|
||
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.
This test asserts on Android 6.0 Marshmallow, as it doesn't appear that
pthread_mutex_destroyreally destroys the mutex there. I notice that if I comment out the line that setsPTHREAD_MUTEX_RECURSIVEin this druntime module, the test passes again, but I haven't dug into why it only doesn't work for recursive mutexes. It doesn't, so this test can't be run as is.Uh oh!
There was an error while loading. Please reload this page.
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.
As the author of this test (and the test below) I think it might have been a mistake to rely on implementation defined behavior here (actually undefined behavior according to the Posix standard). I assumed that
pthread_mutex_trylockwould returnEINVALon all platforms if called with a previously destroyed mutex (otherwise what would be the point of specifying such return value in the standard?).I would love to find a better way to verify that the internal implementation has been destroyed successfully, but I can't think of any other alternatives at the moment.