Open jamescrosswell opened 1 month ago
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
int
bool
Interlocked
enum
With .net9 Interlocked.CompareExchange supports more types.
We should leverage the new type support to tidy up our code.
In various places in the solution we're using
int
instead ofbool
so that we can make use of theInterlocked
class, which historically did not supportbool
andenum
. For example: https://github.com/getsentry/sentry-dotnet/blob/96a116c6076d358d6e0c06a1f012c1ed2c7a65d1/src/Sentry.Profiling/SampleProfilerSession.cs#L58-L68With .net9 Interlocked.CompareExchange supports more types.
We should leverage the new type support to tidy up our code.