-
-
Notifications
You must be signed in to change notification settings - Fork 229
Closed
Labels
.NETPull requests that update .net codePull requests that update .net codeGood First IssueGood for newcomersGood for newcomersTask
Description
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:
sentry-dotnet/src/Sentry.Profiling/SampleProfilerSession.cs
Lines 58 to 68 in 96a116c
| internal static bool ThrowOnNextStartupForTests | |
| { | |
| get { return Interlocked.CompareExchange(ref _throwOnNextStartupForTests, 1, 1) == 1; } | |
| set | |
| { | |
| if (value) | |
| Interlocked.CompareExchange(ref _throwOnNextStartupForTests, 1, 0); | |
| else | |
| Interlocked.CompareExchange(ref _throwOnNextStartupForTests, 0, 1); | |
| } | |
| } |
With .net9 Interlocked.CompareExchange supports more types.
We should leverage the new type support to tidy up our code.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
.NETPull requests that update .net codePull requests that update .net codeGood First IssueGood for newcomersGood for newcomersTask
Projects
Status
Done
Status
No status