Download to file
| 269 | c->done.store(true, std::memory_order_release); |
| 270 | c->event->Set(); |
| 271 | return 0; |
| 272 | } |
| 273 | |
| 274 | // Use independent thread for file download |
| 275 | #define MT_DOWNLOAD 1 |
| 276 | |
| 277 | #if MT_DOWNLOAD |
| 278 | |
| 279 | #ifdef _WIN32 |
| 280 | // Download to file |
| 281 | static void DownloadToFileOverlapped(DownloadToFileContext* context) |
| 282 | { |
| 283 | DWORD threadId; |
| 284 | HANDLE handle = CreateThread(nullptr, 0, DownloadToFileThread, context, 0, &threadId); |
| 285 | if (!handle) |
| 286 | { |
| 287 | // create thread failed - fallback to direct processing |
| 288 | DownloadToFileThread(context); |
no test coverage detected