diff options
| author | louist103 <35883445+louist103@users.noreply.github.com> | 2025-04-12 19:59:19 -0400 |
|---|---|---|
| committer | louist103 <35883445+louist103@users.noreply.github.com> | 2025-04-12 19:59:19 -0400 |
| commit | 684f21a475dcfeee89938ae1f4afc42768a3e7ef (patch) | |
| tree | a457d9d595d88b71ebbfd04224bb669dbfcff331 | |
| parent | 42ae9dc955e2aec15b6ebea3a94d5a131404bbb5 (diff) | |
Fix volatile
| -rw-r--r-- | ZAPD/Main.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/ZAPD/Main.cpp b/ZAPD/Main.cpp index 3f9b25d..4598da9 100644 --- a/ZAPD/Main.cpp +++ b/ZAPD/Main.cpp @@ -135,7 +135,7 @@ ZFileMode ParseFileMode(const std::string& buildMode, ExporterSet* exporterSet); int HandleExtract(ZFileMode fileMode, ExporterSet* exporterSet); int ExtractFunc(int workerID, int fileListSize, std::string fileListItem, ZFileMode fileMode); -volatile int numWorkersLeft = 0; +std::atomic<unsigned int> numWorkersLeft = 0; extern const char gBuildHash[]; @@ -659,15 +659,15 @@ int HandleExtract(ZFileMode fileMode, ExporterSet* exporterSet) bool parseSuccessful; auto start = std::chrono::steady_clock::now(); - int fileListSize = fileList.size(); - Globals::Instance->singleThreaded = false; + size_t fileListSize = fileList.size(); + Globals::Instance->singleThreaded = true; - for (int i = 0; i < fileListSize; i++) + for (size_t i = 0; i < fileListSize; i++) Globals::Instance->workerData[i] = new FileWorker(); numWorkersLeft = fileListSize; - for (int i = 0; i < fileListSize; i++) + for (size_t i = 0; i < fileListSize; i++) { if (Globals::Instance->singleThreaded) { |
