diff --git a/native/cocos/network/DownloaderImpl-apple.mm b/native/cocos/network/DownloaderImpl-apple.mm index f9ca1dacb3..7a4845def9 100644 --- a/native/cocos/network/DownloaderImpl-apple.mm +++ b/native/cocos/network/DownloaderImpl-apple.mm @@ -28,7 +28,7 @@ of this software and associated engine source code (the "Software"), a limited, #import #include "application/ApplicationManager.h" #include "base/memory/Memory.h" -#include "base/std/container/queue.h" +#include "base/std/container/list.h" #include "base/UTF8.h" #include "network/Downloader.h" #include "platform/FileUtils.h" @@ -54,7 +54,8 @@ - (uint32_t)transferDataToBuffer:(void *)buffer lengthOfBuffer:(uint32_t)len; @interface DownloaderAppleImpl : NSObject { const cc::network::DownloaderApple *_outer; cc::network::DownloaderHints _hints; - ccstd::queue _taskQueue; + ccstd::list _waitingList; + int _runningCount; } @property (nonatomic, strong) NSURLSession *downloadSession; @property (nonatomic, strong) NSMutableDictionary *taskDict; // ocTask: DownloadTaskWrapper @@ -203,6 +204,7 @@ - (id)init:(const cc::network::DownloaderApple *)o hints:(const cc::network::Dow _hints = hints; // create task dictionary self.taskDict = [NSMutableDictionary dictionary]; + _runningCount = 0; #if CC_PLATFORM == CC_PLATFORM_IOS // create backgroundSession for iOS to support background download @@ -264,11 +266,11 @@ - (NSURLSessionDataTask *)createDataTask:(std::shared_ptr