Skip to content

Commit

Permalink
Deadlock on application exit when an error occurs in case of asynchro…
Browse files Browse the repository at this point in the history
…nous Program.main()
  • Loading branch information
NikolayPianikov committed Jan 31, 2025
1 parent 5e1603b commit ea9bab7
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 10 deletions.
65 changes: 63 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: CSharpInteractive check
name: CSharpInteractive build

on: [ push, pull_request ]

jobs:
build:

ubuntu build:

runs-on: ubuntu-latest

Expand Down Expand Up @@ -32,3 +33,63 @@ jobs:

- name: Build
run: dotnet run --project ./Build

mac build:

runs-on: macos-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'

- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'

- name: Setup .NET 9
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'

- name: Build
run: dotnet run --project ./Build

windows build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'

- name: Setup .NET 7
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'

- name: Setup .NET 9
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0.x'

- name: Build
run: dotnet run --project ./Build
8 changes: 0 additions & 8 deletions CSharpInteractive/Core/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ public void Exit(int exitCode)
return;
}

WindowsNativeExit(exitCode);
var exitThread = new Thread(() => System.Environment.Exit(exitCode));
exitThread.Start();
if (exitThread.Join(100))
{
return;
}

NativeExit(exitCode);
}

Expand Down

0 comments on commit ea9bab7

Please sign in to comment.