You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 51b1e92
Browse filesBrowse the repository at this point in the historyBrowse files
Revert "A few fixes in the threadpool semaphore. Unify Windows/Unix implementation of LIFO policy." (dotnet#125193)
Reverts dotnet#123921
This change appears to have caused a large regression in NuGet restore
performance. Reverting is confirmed to produce a significant improvement
(10-15%).
Copy file name to clipboardExpand all lines: docs/coding-guidelines/interop-guidelines.md
+12-11Lines changed: 12 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ internal static partial class Interop
34
34
...
35
35
internalstaticpartialclassInterop
36
36
{
37
-
internalstaticpartialclassMincore { ... }
37
+
internalstaticpartialclassmincore { ... }
38
38
}
39
39
```
40
40
- With few exceptions, the only methods that should be defined in these interop types are DllImports.
@@ -49,9 +49,7 @@ internal static partial class Interop
49
49
```
50
50
\Common\src\Interop
51
51
\Windows
52
-
\Kernel32
53
-
... interop files
54
-
\Mincore
52
+
\mincore
55
53
... interop files
56
54
\Unix
57
55
\libc
@@ -73,8 +71,8 @@ As shown above, platforms may be additive, in that an assembly may use functiona
73
71
\libc
74
72
\Interop.strerror.cs
75
73
\Windows
76
-
\Mincore
77
-
\Interop.WaitOnAddress.cs <-- Also contains WakeByAddressSingle
74
+
\mincore
75
+
\Interop.OutputDebugString.cs
78
76
```
79
77
80
78
- If structs/constants will be used on their own without an associated DllImport, or if they may be used with multiple DllImports not in the same file, they should be declared in a separate file.
@@ -83,9 +81,9 @@ As shown above, platforms may be additive, in that an assembly may use functiona
83
81
```
84
82
\Common\src\Interop
85
83
\Windows
86
-
\Kernel32
87
-
\Interop.DuplicateHandle_SafeFileHandle.cs
88
-
\Interop.DuplicateHandle_SafePipeHandle.cs
84
+
\mincore
85
+
\Interop.DuplicateHandle_SafeTokenHandle.cs
86
+
\Interop.DuplicateHandle_IntPtr.cs
89
87
```
90
88
91
89
- The library names used per-platform are stored in internal constants in the Interop class in a private Libraries class in a per-platform file named Interop.Libraries.cs. These constants are then used for all DllImports to that library, rather than having the string duplicated each time, e.g.
@@ -96,9 +94,12 @@ internal static partial class Interop // contents of Common\src\Interop\Windows\
0 commit comments