sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

Use bools and enums with Interlocked.CompareExchange

Open jamescrosswell opened this issue 4 months ago • 0 comments

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.

jamescrosswell avatar Oct 16 '24 20:10 jamescrosswell