Skip to content

Conversation

@bretambrose
Copy link
Contributor

@bretambrose bretambrose commented May 8, 2023

Revert the changes that prevented multi-init of the NAPI module and add ref-counting support and careful, matching shutdown when the last ref goes away.

aws/aws-iot-device-sdk-js-v2#360

A more complex solution might consider making elg/hr/bootstrap a per-environment set of data, but for now, the simplest approach with the least possibility of error is to simply have all environments reference a shared triple and use ref-counting to drop the triple once no env-users remain.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link
Contributor

@graebm graebm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work!!!
I'd like to do a pass on all our library_init() calls to make them work like this someday, protected by a lock and refcount.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants