File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Diagnostics ;
3
+ using System . Runtime . ConstrainedExecution ;
3
4
using System . Globalization ;
4
5
using System . Runtime . InteropServices ;
5
6
using System . Threading ;
@@ -13,7 +14,7 @@ internal abstract class SafeHandleBase : SafeHandle
13
14
#endif
14
15
15
16
/// <summary>
16
- /// This is set to non-zero when <see cref="NativeMethods.AddHandle"/> has
17
+ /// This is set to 1 when <see cref="NativeMethods.AddHandle"/> has
17
18
/// been called for this handle.
18
19
/// </summary>
19
20
private int registered = 0 ;
@@ -53,6 +54,7 @@ protected override void Dispose(bool disposing)
53
54
UnregisterHandle () ;
54
55
}
55
56
57
+ [ ReliabilityContract ( Consistency . WillNotCorruptState , Cer . Success ) ]
56
58
private void UnregisterHandle ( )
57
59
{
58
60
int n = Interlocked . Decrement ( ref registered ) ;
Original file line number Diff line number Diff line change @@ -41,11 +41,13 @@ public LibraryLifetimeObject()
41
41
}
42
42
}
43
43
44
+ [ ReliabilityContract ( Consistency . WillNotCorruptState , Cer . Success ) ]
44
45
internal static void AddHandle ( )
45
46
{
46
47
Interlocked . Increment ( ref handlesCount ) ;
47
48
}
48
49
50
+ [ ReliabilityContract ( Consistency . WillNotCorruptState , Cer . Success ) ]
49
51
internal static void RemoveHandle ( )
50
52
{
51
53
int hCount = Interlocked . Decrement ( ref handlesCount ) ;
You can’t perform that action at this time.
0 commit comments