Skip to content

Commit 7b8544e

Browse files
authored
Merge pull request #4182 from Taron-art/fix/4145-Opening-shared-package-hangs-the-application
2 parents 5df3552 + 80710b4 commit 7b8544e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/UniGetUI.Core.Classes/TaskRecycler.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ private static async Task _runTaskAndWait_VOID(Task task, int hash, int cacheTim
108108
{
109109
// Race condition, an equivalent task got added from another thread between the TryGetValue and TryAdd,
110110
// so we are going to restart the call to _runTaskAndWait in order for TryGetValue to return the new task again
111-
await _runTaskAndWait_VOID(task, hash, cacheTimeSecsSecs);
111+
await _runTaskAndWait_VOID(task, hash, cacheTimeSecsSecs).ConfigureAwait(false);
112112
return;
113113
}
114114
else
@@ -118,7 +118,7 @@ private static async Task _runTaskAndWait_VOID(Task task, int hash, int cacheTim
118118
}
119119

120120
// Wait for the task to finish
121-
await task;
121+
await task.ConfigureAwait(false);
122122

123123
// Schedule the task for removal after the cache time expires
124124
_removeFromCache_VOID(hash, cacheTimeSecsSecs);
@@ -138,7 +138,7 @@ private static async Task<ReturnT> _runTaskAndWait(Task<ReturnT> task, int hash,
138138
{
139139
// Race condition, an equivalent task got added from another thread between the TryGetValue and TryAdd,
140140
// so we are going to restart the call to _runTaskAndWait in order for TryGetValue to return the new task again
141-
return await _runTaskAndWait(task, hash, cacheTimeSecsSecs);
141+
return await _runTaskAndWait(task, hash, cacheTimeSecsSecs).ConfigureAwait(false);
142142
}
143143
else
144144
{
@@ -147,7 +147,7 @@ private static async Task<ReturnT> _runTaskAndWait(Task<ReturnT> task, int hash,
147147
}
148148

149149
// Wait for the task to finish
150-
ReturnT result = await task;
150+
ReturnT result = await task.ConfigureAwait(false);
151151

152152
// Schedule the task for removal after the cache time expires
153153
_removeFromCache(hash, cacheTimeSecsSecs);

0 commit comments

Comments
 (0)