Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
7e4f3149
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,发现更多精彩内容 >>
提交
7e4f3149
编写于
6月 13, 2016
作者:
A
Artur Spychaj
提交者:
GitHub
6月 13, 2016
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11904 from drognanar/fixreploutput2
Print remaining REPL output if it crashes in VS host
上级
820cd02d
b38e6089
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
16 addition
and
13 deletion
+16
-13
src/Interactive/Features/Interactive/Core/InteractiveHost.RemoteService.cs
...eatures/Interactive/Core/InteractiveHost.RemoteService.cs
+10
-7
src/Interactive/Features/Interactive/Core/InteractiveHost.cs
src/Interactive/Features/Interactive/Core/InteractiveHost.cs
+6
-6
未找到文件。
src/Interactive/Features/Interactive/Core/InteractiveHost.RemoteService.cs
浏览文件 @
7e4f3149
...
...
@@ -21,6 +21,7 @@ internal sealed class RemoteService
private
Thread
_readOutputThread
;
// nulled on dispose
private
Thread
_readErrorOutputThread
;
// nulled on dispose
private
InteractiveHost
_host
;
// nulled on dispose
private
bool
_disposing
;
// set to true on dispose
internal
RemoteService
(
InteractiveHost
host
,
Process
process
,
int
processId
,
Service
service
)
{
...
...
@@ -29,6 +30,7 @@ internal RemoteService(InteractiveHost host, Process process, int processId, Ser
Debug
.
Assert
(
service
!=
null
);
_host
=
host
;
_disposing
=
false
;
this
.
Process
=
process
;
_processId
=
processId
;
this
.
Service
=
service
;
...
...
@@ -61,7 +63,7 @@ internal void HookAutoRestartEvent()
{
Process
.
Exited
-=
localHandler
;
if
(!
IsDisposed
)
if
(!
_disposing
)
{
await
_host
.
OnProcessExited
(
Process
).
ConfigureAwait
(
false
);
}
...
...
@@ -73,7 +75,7 @@ internal void HookAutoRestartEvent()
}
};
// hook the even only once per process:
// hook the even
t
only once per process:
if
(
Interlocked
.
Exchange
(
ref
processExitHandling
,
ProcessExitHooked
)
==
0
)
{
Process
.
Exited
+=
localHandler
;
...
...
@@ -110,12 +112,10 @@ private void ReadOutput(bool error)
}
}
private
bool
IsDisposed
=>
_host
==
null
;
internal
void
Dispose
(
bool
joinThreads
)
{
//
null the host so that we don't attempt to restart or write to the buffer
anymore:
_
host
=
null
;
//
set _disposing so that we don't attempt restart the host
anymore:
_
disposing
=
true
;
InitiateTermination
(
Process
,
_processId
);
...
...
@@ -147,6 +147,9 @@ internal void Dispose(bool joinThreads)
}
}
// null the host so that we don't attempt to write to the buffer anymore:
_host
=
null
;
_readOutputThread
=
_readErrorOutputThread
=
null
;
}
...
...
src/Interactive/Features/Interactive/Core/InteractiveHost.cs
浏览文件 @
7e4f3149
...
...
@@ -76,7 +76,7 @@ internal Process TryGetProcess()
internal
Service
TryGetService
()
{
var
initializedService
=
TryGetOrCreateRemoteServiceAsync
().
Result
;
var
initializedService
=
TryGetOrCreateRemoteServiceAsync
(
processPendingOutput
:
false
).
Result
;
return
initializedService
.
ServiceOpt
?.
Service
;
}
...
...
@@ -312,7 +312,7 @@ private LazyRemoteService CreateRemoteService(InteractiveHostOptions options, bo
private
Task
OnProcessExited
(
Process
process
)
{
ReportProcessExited
(
process
);
return
TryGetOrCreateRemoteServiceAsync
();
return
TryGetOrCreateRemoteServiceAsync
(
processPendingOutput
:
true
);
}
private
void
ReportProcessExited
(
Process
process
)
...
...
@@ -333,7 +333,7 @@ private void ReportProcessExited(Process process)
}
}
private
async
Task
<
InitializedRemoteService
>
TryGetOrCreateRemoteServiceAsync
()
private
async
Task
<
InitializedRemoteService
>
TryGetOrCreateRemoteServiceAsync
(
bool
processPendingOutput
)
{
try
{
...
...
@@ -357,7 +357,7 @@ private async Task<InitializedRemoteService> TryGetOrCreateRemoteServiceAsync()
if
(
previousService
==
currentRemoteService
)
{
// we replaced the service whose process we know is dead:
currentRemoteService
.
Dispose
(
joinThreads
:
false
);
currentRemoteService
.
Dispose
(
processPendingOutput
);
currentRemoteService
=
newService
;
}
else
...
...
@@ -387,7 +387,7 @@ private async Task<TResult> Async<TResult>(Action<Service, RemoteAsyncOperation<
{
try
{
var
initializedService
=
await
TryGetOrCreateRemoteServiceAsync
().
ConfigureAwait
(
false
);
var
initializedService
=
await
TryGetOrCreateRemoteServiceAsync
(
processPendingOutput
:
false
).
ConfigureAwait
(
false
);
if
(
initializedService
.
ServiceOpt
==
null
)
{
return
default
(
TResult
);
...
...
@@ -434,7 +434,7 @@ public async Task<RemoteExecutionResult> ResetAsync(InteractiveHostOptions optio
oldService
.
Dispose
(
joinThreads
:
false
);
}
var
initializedService
=
await
TryGetOrCreateRemoteServiceAsync
().
ConfigureAwait
(
false
);
var
initializedService
=
await
TryGetOrCreateRemoteServiceAsync
(
processPendingOutput
:
false
).
ConfigureAwait
(
false
);
if
(
initializedService
.
ServiceOpt
==
null
)
{
return
default
(
RemoteExecutionResult
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录