-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Console.Unix: avoid deadlock between LazyInitializer and Console.Out (#…
…34297) * Console.Unix: avoid deadlock between LazyInitializer and Console.Out * Add assert for InternalSyncObject * Console: use Interlocked for lazy initialization * Cleanup unused 'using' * Limit locking to event handlers * Fix AllowNull -> NotNull * Localize LazyInitializer.EnsureInitialized logic * Remove lazy initialize delegates * Use static local functions for initializing * Remove unused EnsureInitializedDisposableCore * Remove unused arg from EnsureInitializedStdInReader * Also EnsureInitialize when not redirected * Dispose Console Streams with their Reader/Writer * Fix s_out -> s_error * leaveOpen streams, fix Encoding set race * Fix races between Encoding en initializers of In/Out/Error * Remove EnsureInitialized * Cleanup * Rename static local initializer functions to EnsureInitialized * Use lock in Input/OutputEncoding * Rename InternalSyncObject to s_syncObject * Cleanup space * Fix _isStdErrRedirected -> _isStdInRedirected * Remove space * Improve comments * Fix potential CancelKeyPress deadlock * Apply suggestions from code review Co-Authored-By: Stephen Toub <stoub@microsoft.com> * Remove unnecessary null forgiving * Add comment about why we're not Disposing StdInReader * Add Volatile.Writes for Volatile.Read fields * More Volatile.Writes * Add back lock to SetIn Co-authored-by: Stephen Toub <stoub@microsoft.com>
- Loading branch information
1 parent
2bcc336
commit 59a24e5
Showing
4 changed files
with
171 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters