MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / SetAsyncSaveFinish

Function SetAsyncSaveFinish

src/saveload/saveload.cpp:383–389  ·  view source on GitHub ↗

* Called by save thread to tell we finished saving. * @param proc The callback to call when saving is done. */

Source from the content-addressed store, hash-verified

381 * @param proc The callback to call when saving is done.
382 */
383static void SetAsyncSaveFinish(AsyncSaveFinishProc proc)
384{
385 if (_exit_game) return;
386 while (_async_save_finish.load(std::memory_order_acquire) != nullptr) CSleep(10);
387
388 _async_save_finish.store(proc, std::memory_order_release);
389}
390
391/**
392 * Handle async save finishes.

Callers 1

SaveFileToDiskFunction · 0.85

Calls 1

CSleepFunction · 0.85

Tested by

no test coverage detected