Explicitly unlock _mruPeasants when we are done with it to prevent a deadlock from being introduced.
This commit is contained in:
parent
e1c2f5380f
commit
80646b33a4
|
@ -446,8 +446,10 @@ namespace winrt::Microsoft::Terminal::Remoting::implementation
|
|||
std::shared_lock lock{ _mruPeasantsMutex };
|
||||
if (_mruPeasants.empty())
|
||||
{
|
||||
// unlock the mruPeasants mutex to make sure we can't deadlock here.
|
||||
lock.unlock();
|
||||
// Only need a shared lock for read
|
||||
std::shared_lock lock{ _peasantsMutex };
|
||||
std::shared_lock peasantsLock{ _peasantsMutex };
|
||||
// We haven't yet been told the MRU peasant. Just use the first one.
|
||||
// This is just gonna be a random one, but really shouldn't happen
|
||||
// in practice. The WindowManager should set the MRU peasant
|
||||
|
|
Loading…
Reference in a new issue