mirror of
https://github.com/osukey/osukey.git
synced 2025-05-20 04:57:38 +09:00
Avoid semaphore potentially getting held forever
This commit is contained in:
parent
994fb2667d
commit
0f09a7feb9
@ -67,7 +67,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
{
|
{
|
||||||
cancelExistingConnect();
|
cancelExistingConnect();
|
||||||
|
|
||||||
await connectionLock.WaitAsync();
|
await connectionLock.WaitAsync(10000);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -183,7 +183,7 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
cancelExistingConnect();
|
cancelExistingConnect();
|
||||||
|
|
||||||
if (takeLock)
|
if (takeLock)
|
||||||
await connectionLock.WaitAsync();
|
await connectionLock.WaitAsync(10000);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -237,5 +237,12 @@ namespace osu.Game.Online.Multiplayer
|
|||||||
};
|
};
|
||||||
return newConnection;
|
return newConnection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Dispose(bool isDisposing)
|
||||||
|
{
|
||||||
|
base.Dispose(isDisposing);
|
||||||
|
|
||||||
|
cancelExistingConnect();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user