From 5ec8ad8890285ad9f0539a0a13fa6c6610d29b14 Mon Sep 17 00:00:00 2001 From: in0finite Date: Mon, 24 Jan 2022 01:51:48 +0100 Subject: [PATCH] rename method --- Assets/Scripts/Editor/AssetExporter.cs | 4 ++-- Assets/Scripts/Utilities/LoadingThread.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/Editor/AssetExporter.cs b/Assets/Scripts/Editor/AssetExporter.cs index 55569d27..058c8735 100644 --- a/Assets/Scripts/Editor/AssetExporter.cs +++ b/Assets/Scripts/Editor/AssetExporter.cs @@ -332,7 +332,7 @@ namespace SanAndreasUnity.Editor float diffPerc = endPerc - startPerc; - long initialNumPendingJobs = LoadingThread.Singleton.GetNumJobsPending(); + long initialNumPendingJobs = LoadingThread.Singleton.GetNumJobsPendingApproximately(); yield return null; // this must be done, otherwise LoadingThread does not start processing any job @@ -341,7 +341,7 @@ namespace SanAndreasUnity.Editor { LoadingThread.Singleton.UpdateJobs(); - numPendingJobs = LoadingThread.Singleton.GetNumJobsPending(); + numPendingJobs = LoadingThread.Singleton.GetNumJobsPendingApproximately(); long numJobsProcessed = initialNumPendingJobs - numPendingJobs; float currentPerc = startPerc + diffPerc * (numJobsProcessed / (float)initialNumPendingJobs); diff --git a/Assets/Scripts/Utilities/LoadingThread.cs b/Assets/Scripts/Utilities/LoadingThread.cs index cd44cce8..ae491a0f 100644 --- a/Assets/Scripts/Utilities/LoadingThread.cs +++ b/Assets/Scripts/Utilities/LoadingThread.cs @@ -209,7 +209,7 @@ namespace SanAndreasUnity.Behaviours } } - public long GetNumJobsPending() + public long GetNumJobsPendingApproximately() { // this is not done in a critical section: calling Count on 2 multithreaded collections return (long)_threadParameters.jobs.Count + (long)_threadParameters.processedJobs.Count + (long)_processedJobsBuffer.Count;