Skip to content

libdispatch threads should call GSUnregisterCurrentThread() on exit #428

@triplef

Description

@triplef

Threads started by libdispatch currently don’t clean up their NSThread data when the threads exit. This can cause issues e.g. when [[NSThread currentThread] threadDictionary] is used from such threads as this data will never get released.

libdispatch has a _dispatch_install_thread_detach_callback() hook (currently only available on Android) that can be used for this. We currently use a libdispatch patch to make the hook available on all platforms and install a hook to call GSUnregisterCurrentThread() on thread exit in our app.

It would be nice to install the hook callback from libs-base if the hook is available. To start with I’ll open a libdispatch pull request with our patch.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions