Skip to content

Conversation

nachoBonafonte
Copy link
Member

Updated SDK locks to use a more similar to Apple Concurrency's Mutex approach, which allows being used in the future when we transition to Swift 6. It also allows the compiler to help with the errors as the type itself includes the lock.
Removed inout to properties that dont need it.
Updated some properties to constants when mutability is not needed
Cleaned also most warnings

Updated SDK locks to use a more similar to Mutex approach, which allows being used in the future when we transition to Swift 6
Removed inout to properties that dont need it.
Updated some properties to constants when mutability is not needed
Cleaned also most warnings
@@ -40,8 +40,8 @@ public extension InstrumentBuilder {
return self
}

internal func swapBuilder<T: InstrumentBuilder>(_ builder: (inout MeterProviderSharedState, inout MeterSharedState, String, String, String) -> T) -> T {
Copy link
Member

Choose a reason for hiding this comment

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

I believe if these are not inout then the internal readerStorageRegisteries and callbackRegistration will not be shared and updated in the MeterProvider

Copy link
Member Author

@nachoBonafonte nachoBonafonte Jul 17, 2025

Choose a reason for hiding this comment

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

But they are classes aren't they, the instances themselves are not changing, I thought it was a remaining if they were structs during development.

Are there any test for it?

Copy link
Member

Choose a reason for hiding this comment

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

After doing some testing, this appears to not be the case? I remember adding inout for a specific reason that was related to the propagation of these objects.

Copy link
Member Author

@nachoBonafonte nachoBonafonte Jul 17, 2025

Choose a reason for hiding this comment

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

Did you initially made them structs, and changed later to classes? If they were structs inout would be needed.

Copy link
Member

Choose a reason for hiding this comment

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

yes, that may have been the issue.

@nachoBonafonte nachoBonafonte enabled auto-merge (squash) July 17, 2025 19:19
@nachoBonafonte nachoBonafonte merged commit 048f419 into open-telemetry:main Jul 17, 2025
10 checks passed
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