This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SaveStateExample.cpp (C++11) | |
| // AUTHOR: xixas | DATE: 2021.12.31 | LICENSE: WTFPL/PDM/CC0... your choice | |
| // DESCRIPTION: Gaming: World-state snapshot example for non-interrupting saves. | |
| // BUILD: g++ -o save-state-example SaveStateExample.cpp -lpthread -std=c++11 | |
| #include <cstdio> // printf | |
| #include <atomic> // std::atomic | |
| #include <mutex> // std::mutex | |
| #include <thread> // std::thread, std::this_thread | |
| #include <chrono> // std::chrono |
NewerOlder