mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-16 21:07:43 +01:00
Make IsMainThreadInPresent and CumulativePresentCalls clearer
This commit is contained in:
parent
6d8102dc79
commit
3f138c2600
2 changed files with 11 additions and 9 deletions
|
|
@ -380,7 +380,7 @@ internal sealed partial class TextureManager
|
|||
// Not sure why this and the below can't be unconditional RunOnFrameworkThread
|
||||
private async Task RunDuringPresent(Action action)
|
||||
{
|
||||
if (this.interfaceManager.IsInPresent && ThreadSafety.IsMainThread)
|
||||
if (this.interfaceManager.IsMainThreadInPresent && ThreadSafety.IsMainThread)
|
||||
action();
|
||||
else
|
||||
await this.interfaceManager.RunBeforeImGuiRender(action);
|
||||
|
|
@ -392,7 +392,7 @@ internal sealed partial class TextureManager
|
|||
/// <returns>The return value from the function.</returns>
|
||||
private async Task<T> RunDuringPresent<T>(Func<T> func)
|
||||
{
|
||||
if (this.interfaceManager.IsInPresent && ThreadSafety.IsMainThread)
|
||||
if (this.interfaceManager.IsMainThreadInPresent && ThreadSafety.IsMainThread)
|
||||
return func();
|
||||
return await this.interfaceManager.RunBeforeImGuiRender(func);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue