-
-
Notifications
You must be signed in to change notification settings - Fork 421
Thread detach stability #1989
base: master
Are you sure you want to change the base?
Thread detach stability #1989
Conversation
Thanks for your pull request, @acehreli! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Some tips to help speed things up:
Bear in mind that large or tricky changes may require multiple rounds of review and revision. Please see CONTRIBUTING.md for more information. Bugzilla references
|
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.
lgtm
About the tests only failing on macOS 32bit, I haven’t looked at the changes yet but note that macOS 64Bit uses native TLS implementation while 32bit uses a custom implementation. |
I have to determine whether the new test application would fail without the changes to thread.d. Maybe it's just exposing existing issues. Meanwhile, I'm curious about "macOS 64Bit uses native TLS implementation while 32bit uses a custom implementation". Where can I learn more about the differences? |
Mostly in the code in the compiler. I added some documentation about the 64bit implementation [1] [2]. You can read about the custom implementation here [3]. [1] https://github.com/dlang/dmd/blob/master/src/ddmd/backend/el.c#L1284-L1306 |
Removed auto-merge for now to avoid clogging the priority queue of the auto-tester. |
I have encountered this. Why not merge? |
Maybe related to this too? https://issues.dlang.org/show_bug.cgi?id=20085 |
@acehreli can you please fix the merge issues? |
(Trying again after closing PR 1986.)
Apologies for three separate commits. Two of the commits were necessary to get the test program passing.
Prevent returning dangling pointer from thread_attachThis
Call all detach varieties after locking slock. (All other calls to Thread.remove() are done while holding slock.)
Do not pthread_detach non-D threads i.e. the ones that are attached by the user. After all, we don't know and have any say on the lifetimes of such threads.