Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
f26bf6ad
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f26bf6ad
编写于
5月 07, 2020
作者:
S
Sam Harwell
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Mark types as non-copyable
上级
6d9567b2
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
36 addition
and
8 deletion
+36
-8
src/Compilers/Core/Portable/InternalUtilities/ReaderWriterLockSlimExtensions.cs
...table/InternalUtilities/ReaderWriterLockSlimExtensions.cs
+3
-0
src/Compilers/Core/Portable/InternalUtilities/SemaphoreSlimExtensions.cs
...ore/Portable/InternalUtilities/SemaphoreSlimExtensions.cs
+1
-0
src/Dependencies/PooledObjects/PooledDelegates.cs
src/Dependencies/PooledObjects/PooledDelegates.cs
+6
-0
src/Interactive/Host/Microsoft.CodeAnalysis.InteractiveHost.csproj
...active/Host/Microsoft.CodeAnalysis.InteractiveHost.csproj
+1
-0
src/Workspaces/Core/Portable/Shared/Extensions/SafeHandleLease.cs
...spaces/Core/Portable/Shared/Extensions/SafeHandleLease.cs
+2
-0
src/Workspaces/Core/Portable/Storage/SQLite/Interop/SafeSqliteBlobHandle.cs
...e/Portable/Storage/SQLite/Interop/SafeSqliteBlobHandle.cs
+10
-4
src/Workspaces/Core/Portable/Storage/SQLite/Interop/SafeSqliteStatementHandle.cs
...table/Storage/SQLite/Interop/SafeSqliteStatementHandle.cs
+10
-4
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems
...sAndExtensions/Compiler/Core/CompilerExtensions.projitems
+1
-0
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/ObjectPools/PooledDisposer.cs
...AndExtensions/Compiler/Core/ObjectPools/PooledDisposer.cs
+2
-0
未找到文件。
src/Compilers/Core/Portable/InternalUtilities/ReaderWriterLockSlimExtensions.cs
浏览文件 @
f26bf6ad
...
...
@@ -16,6 +16,7 @@ internal static ReadLockExiter DisposableRead(this ReaderWriterLockSlim @lock)
return
new
ReadLockExiter
(
@lock
);
}
[
NonCopyable
]
internal
readonly
struct
ReadLockExiter
:
IDisposable
{
private
readonly
ReaderWriterLockSlim
_lock
;
...
...
@@ -37,6 +38,7 @@ internal static UpgradeableReadLockExiter DisposableUpgradeableRead(this ReaderW
return
new
UpgradeableReadLockExiter
(
@lock
);
}
[
NonCopyable
]
internal
readonly
struct
UpgradeableReadLockExiter
:
IDisposable
{
private
readonly
ReaderWriterLockSlim
_lock
;
...
...
@@ -68,6 +70,7 @@ internal static WriteLockExiter DisposableWrite(this ReaderWriterLockSlim @lock)
return
new
WriteLockExiter
(
@lock
);
}
[
NonCopyable
]
internal
readonly
struct
WriteLockExiter
:
IDisposable
{
private
readonly
ReaderWriterLockSlim
_lock
;
...
...
src/Compilers/Core/Portable/InternalUtilities/SemaphoreSlimExtensions.cs
浏览文件 @
f26bf6ad
...
...
@@ -25,6 +25,7 @@ public static async ValueTask<SemaphoreDisposer> DisposableWaitAsync(this Semaph
return
new
SemaphoreDisposer
(
semaphore
);
}
[
NonCopyable
]
internal
struct
SemaphoreDisposer
:
IDisposable
{
private
readonly
SemaphoreSlim
_semaphore
;
...
...
src/Dependencies/PooledObjects/PooledDelegates.cs
浏览文件 @
f26bf6ad
...
...
@@ -313,6 +313,7 @@ public static Releaser GetPooledAction<TArg>(Action<TArg> unboundAction, TArg ar
/// omitted, the object will not be returned to the pool. The behavior of this type if <see cref="Dispose"/> is
/// called multiple times is undefined.</para>
/// </remarks>
[
NonCopyable
]
public
struct
Releaser
:
IDisposable
{
private
readonly
Poolable
_pooledObject
;
...
...
@@ -416,5 +417,10 @@ private sealed class FuncWithBoundArgument<T1, T2, T3, TArg, TResult>
protected
override
Func
<
T1
,
T2
,
T3
,
TResult
>
Bind
()
=>
(
arg1
,
arg2
,
arg3
)
=>
UnboundDelegate
(
arg1
,
arg2
,
arg3
,
Argument
);
}
[
AttributeUsage
(
AttributeTargets
.
Struct
)]
private
sealed
class
NonCopyableAttribute
:
Attribute
{
}
}
}
src/Interactive/Host/Microsoft.CodeAnalysis.InteractiveHost.csproj
浏览文件 @
f26bf6ad
...
...
@@ -37,6 +37,7 @@
<Reference
Include=
"System.Windows.Forms"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"..\..\Compilers\Core\Portable\InternalUtilities\NonCopyableAttribute.cs"
Link=
"Utilities\NonCopyableAttribute.cs"
/>
<Compile
Include=
"..\..\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\TestHooks\IExpeditableDelaySource.cs"
Link=
"Utilities\IExpeditableDelaySource.cs"
/>
<Compile
Include=
"..\..\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Contract.cs"
Link=
"Utilities\Contract.cs"
/>
<Compile
Include=
"..\..\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\TaskExtensions.cs"
Link=
"Utilities\TaskExtensions.cs"
/>
...
...
src/Workspaces/Core/Portable/Shared/Extensions/SafeHandleLease.cs
浏览文件 @
f26bf6ad
...
...
@@ -6,6 +6,7 @@
using
System
;
using
System.Runtime.InteropServices
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.Shared.Extensions
{
...
...
@@ -13,6 +14,7 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions
/// Represents a lease of a <see cref="SafeHandle"/>.
/// </summary>
/// <seealso cref="SafeHandleExtensions.Lease"/>
[
NonCopyable
]
internal
readonly
struct
SafeHandleLease
:
IDisposable
{
private
readonly
SafeHandle
?
_handle
;
...
...
src/Workspaces/Core/Portable/Storage/SQLite/Interop/SafeSqliteBlobHandle.cs
浏览文件 @
f26bf6ad
...
...
@@ -31,10 +31,16 @@ public sqlite3_blob DangerousGetWrapper()
protected
override
bool
ReleaseHandle
()
{
using
var
_
=
_lease
;
var
result
=
(
Result
)
raw
.
sqlite3_blob_close
(
_wrapper
);
SetHandle
(
IntPtr
.
Zero
);
return
result
==
Result
.
OK
;
try
{
var
result
=
(
Result
)
raw
.
sqlite3_blob_close
(
_wrapper
);
SetHandle
(
IntPtr
.
Zero
);
return
result
==
Result
.
OK
;
}
finally
{
_lease
.
Dispose
();
}
}
}
}
src/Workspaces/Core/Portable/Storage/SQLite/Interop/SafeSqliteStatementHandle.cs
浏览文件 @
f26bf6ad
...
...
@@ -31,10 +31,16 @@ public sqlite3_stmt DangerousGetWrapper()
protected
override
bool
ReleaseHandle
()
{
using
var
_
=
_lease
;
var
result
=
(
Result
)
raw
.
sqlite3_finalize
(
_wrapper
);
SetHandle
(
IntPtr
.
Zero
);
return
result
==
Result
.
OK
;
try
{
var
result
=
(
Result
)
raw
.
sqlite3_finalize
(
_wrapper
);
SetHandle
(
IntPtr
.
Zero
);
return
result
==
Result
.
OK
;
}
finally
{
_lease
.
Dispose
();
}
}
}
}
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/CompilerExtensions.projitems
浏览文件 @
f26bf6ad
...
...
@@ -14,6 +14,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\ExceptionUtilities.cs"
Link=
"InternalUtilities\ExceptionUtilities.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\IReadOnlySet.cs"
Link=
"InternalUtilities\IReadOnlySet.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\KeyValuePairUtil.cs"
Link=
"InternalUtilities\KeyValuePairUtil.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\NonCopyableAttribute.cs"
Link=
"InternalUtilities\NonCopyableAttribute.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\NonDefaultableAttribute.cs"
Link=
"InternalUtilities\NonDefaultableAttribute.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\NullableAttributes.cs"
Link=
"InternalUtilities\NullableAttributes.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\ReferenceEqualityComparer.cs"
Link=
"InternalUtilities\ReferenceEqualityComparer.cs"
/>
...
...
src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/ObjectPools/PooledDisposer.cs
浏览文件 @
f26bf6ad
...
...
@@ -3,9 +3,11 @@
// See the LICENSE file in the project root for more information.
using
System
;
using
Roslyn.Utilities
;
namespace
Microsoft.CodeAnalysis.PooledObjects
{
[
NonCopyable
]
internal
readonly
struct
PooledDisposer
<
TPoolable
>
:
IDisposable
where
TPoolable
:
class
,
IPooled
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录