Commit Graph

10 Commits

Author SHA1 Message Date
Dean Herbert
b4ed7217c1 Bring back HasFlagsFast
.NET version performs poorly on debug.
2024-08-19 19:40:59 +09:00
Dan Balasescu
b4aa48697d Remove HasFlagFast 2024-07-02 13:26:53 +09:00
Dean Herbert
63405204eb Apply NRT to all low-hanging fruit 2022-11-16 19:12:44 +09:00
Dan Balasescu
ba1385330c Automated #nullable processing 2022-06-13 21:57:05 +09:00
Dean Herbert
5ef317be74 Allow waiting on tasks which were created with LongRunning regardless of thread 2022-01-10 22:34:15 +09:00
Dean Herbert
8379393786 Remove secondary method and rename WaitSafelyForResult to GetResultSafely 2022-01-06 22:50:53 +09:00
Dean Herbert
01cd44eb83 Add second extension method for retrieving a Task.Result when the task is guaranteed to be completed 2022-01-05 15:40:27 +09:00
Dean Herbert
9d9aa9ccbf Add exception for usage of .Result within .ContinueWith continuations 2022-01-03 17:10:45 +09:00
Dean Herbert
78c657de41 Replace all usages of Task.Result with extension method with added safety 2022-01-03 16:57:10 +09:00
Dean Herbert
322e5c9585 Replace all usages of Task.Wait with extension method with added safety
As seen recently, it is quite easy in our semi-`async` world to
accidentally cause a deadlock in the TPL thread pool. The cause of this
is a `.Wait()` or `.Result` from within an already `async` context.

Finding these cases by reading code is quite hard, as they can be nested
multiple calls deep. Likewise, I couldn't find an existing analyser that
finds such cases (and to some it is considered a non-issue as the thread
pool should grow to add new threads when it gets in this state - but for
us this can take too long).

This is a proposal to replace all calls with a custom method with added
safety. Note that this PR will intentionally fail as it points out the
issues that are fixed in https://github.com/ppy/osu-framework/pull/4973.

The rationale for this change was that I couldn't cover all cases in
osu! side `TestMultiplayerClient` by reading the code alone.
2022-01-03 16:47:37 +09:00