Skip to content

Commit 59fd9ce

Browse files
Deadlock on application exit when an error occurs in case of asynchronous Program.main()
1 parent 5e1603b commit 59fd9ce

File tree

2 files changed

+64
-11
lines changed

2 files changed

+64
-11
lines changed

.github/workflows/main.yml

Lines changed: 64 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
name: CSharpInteractive check
1+
name: CSharpInteractive build
22

33
on: [ push, pull_request ]
44

55
jobs:
6-
build:
7-
6+
7+
ubuntu_build:
8+
89
runs-on: ubuntu-latest
910

1011
steps:
@@ -32,3 +33,63 @@ jobs:
3233

3334
- name: Build
3435
run: dotnet run --project ./Build
36+
37+
mac_build:
38+
39+
runs-on: macos-latest
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
44+
- name: Setup .NET 6
45+
uses: actions/setup-dotnet@v3
46+
with:
47+
dotnet-version: '6.0.x'
48+
49+
- name: Setup .NET 7
50+
uses: actions/setup-dotnet@v3
51+
with:
52+
dotnet-version: '7.0.x'
53+
54+
- name: Setup .NET 8
55+
uses: actions/setup-dotnet@v3
56+
with:
57+
dotnet-version: '8.0.x'
58+
59+
- name: Setup .NET 9
60+
uses: actions/setup-dotnet@v3
61+
with:
62+
dotnet-version: '9.0.x'
63+
64+
- name: Build
65+
run: dotnet run --project ./Build
66+
67+
windows_build:
68+
69+
runs-on: windows-latest
70+
71+
steps:
72+
- uses: actions/checkout@v4
73+
74+
- name: Setup .NET 6
75+
uses: actions/setup-dotnet@v3
76+
with:
77+
dotnet-version: '6.0.x'
78+
79+
- name: Setup .NET 7
80+
uses: actions/setup-dotnet@v3
81+
with:
82+
dotnet-version: '7.0.x'
83+
84+
- name: Setup .NET 8
85+
uses: actions/setup-dotnet@v3
86+
with:
87+
dotnet-version: '8.0.x'
88+
89+
- name: Setup .NET 9
90+
uses: actions/setup-dotnet@v3
91+
with:
92+
dotnet-version: '9.0.x'
93+
94+
- name: Build
95+
run: dotnet run --project ./Build

CSharpInteractive/Core/Environment.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,6 @@ public void Exit(int exitCode)
8686
return;
8787
}
8888

89-
WindowsNativeExit(exitCode);
90-
var exitThread = new Thread(() => System.Environment.Exit(exitCode));
91-
exitThread.Start();
92-
if (exitThread.Join(100))
93-
{
94-
return;
95-
}
96-
9789
NativeExit(exitCode);
9890
}
9991

0 commit comments

Comments
 (0)