Skip to content

Conversation

@PaulHigin
Copy link
Contributor

PR Summary

This fixes a possible race condition during abrupt (Ctrl+C) stop of foreach -parallel, where a powerShell object does not get disposed.

PR Context

The powershell.dispose() method is not thread safe and so we prevent it from being called twice during an asynchronous stop command (Ctrl+C). This change add an extra condition to allow a normally completing thread to dispose a powershell object after stop has been commanded.

PR Checklist

@PaulHigin PaulHigin requested a review from TravisEz13 March 30, 2020 17:22
@adityapatwardhan adityapatwardhan merged commit 7837a53 into PowerShell:master Apr 7, 2020
@adityapatwardhan adityapatwardhan added this to the 7.1.0-preview.2 milestone Apr 7, 2020
@adityapatwardhan adityapatwardhan added the CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log label Apr 7, 2020
@ghost
Copy link

ghost commented Apr 23, 2020

🎉v7.1.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-General Indicates that a PR should be marked as a general cmdlet change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants