sentry-dotnet
sentry-dotnet copied to clipboard
Use bools and enums with Interlocked.CompareExchange
In various places in the solution we're using int
instead of bool
so that we can make use of the Interlocked
class, which historically did not support bool
and enum
. For example:
https://github.com/getsentry/sentry-dotnet/blob/96a116c6076d358d6e0c06a1f012c1ed2c7a65d1/src/Sentry.Profiling/SampleProfilerSession.cs#L58-L68
With .net9 Interlocked.CompareExchange supports more types.
We should leverage the new type support to tidy up our code.