-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to a semaphoreslim in the workspace. #51215
Conversation
3258bca
to
05a3950
Compare
@@ -199,7 +199,7 @@ public async Task InitializeUIAffinitizedServicesAsync(IAsyncServiceProvider asy | |||
var openFileTracker = await OpenFileTracker.CreateAsync(this, asyncServiceProvider).ConfigureAwait(true); | |||
|
|||
// Update our fields first, so any asynchronous work that needs to use these is able to see the service. | |||
lock (_gate) | |||
using (_gate.DisposableWait()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not DisposableWaitAsync
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was initially making just a straight translation. but we can def update tehse calls to be DisposableWaitAsync as well .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How confident are we that reentrancy is impossible?
Not at all confident. I've already found one case of reentrancy. Though, IMO, these cases are boken as well. In cases of non-virtual calls, it's clear what the right code is. In the case of virtuals, it's not at all clear given that we might have subclasses doing strange things. So definitely concerning. |
CLosing out for now. I don't feel this can be done particularly safely. We have reentrancy, and there is a lot of virtual calls here that make it difficult to ensure the same behavior and now risk of deadlocks. |
Pulled out from #51138 for independent review.