Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add init functions to support thread safe init of impls #102

Merged
merged 14 commits into from
Mar 26, 2025

Conversation

DmitriyMusatkin
Copy link
Contributor

@DmitriyMusatkin DmitriyMusatkin commented Mar 25, 2025

Issue #, if available:

Description of changes:
relevant issue aws/aws-sdk-cpp#3350
we lazily initialize impls on the first call. some tools will detect it as thread unsafe, even if in practice it is safe.
add explicit init functions to work around the problem.

In addition some minor cleanup is done on exports header.

  • AWS_C_RT_USE_WINDOWS_DLL_SEMANTICS is renamed to AWS_CRT_USE_WINDOWS_DLL_SEMANTICS, since it looks like that was original intent, but there was a typo in the old pr.
  • and removing some logic for gcc < 4, since we stopped supporting it long ago

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

Comment on lines 17 to 18
* which some tools picked up as thread unsafe. As best practice prefer explicit init
* before using this library.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we just say that you must call this? It would be weird trying to maintain where people may or may not call library init. It will be a breaking change, but if in the future someone just adds something to the init, it might break some people if we don't enforce this now.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with Waqar. Say it is required

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, reworded to make it stronger.

Comment on lines 17 to 18
* which some tools picked up as thread unsafe. As best practice prefer explicit init
* before using this library.
Copy link
Contributor

Choose a reason for hiding this comment

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

Agree with Waqar. Say it is required

Co-authored-by: Waqar Ahmed Khan <[email protected]>
@DmitriyMusatkin DmitriyMusatkin merged commit 32e69ae into main Mar 26, 2025
53 checks passed
@DmitriyMusatkin DmitriyMusatkin deleted the thread-safe branch March 26, 2025 20:56
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.

4 participants