Add Sleep Test for 50ms.
Fix Sleep under linux that was using microseconds as nanoseconds.
Factor timespec creation to template function using div/mod and nanoseconds
from duration cast.
Test logical_processor_count() 3 times to test static return value stays
correct.
Run EnableAffinityConfiguration(). No asserts possible.
Test setting thread id, test using uint32_t max to reset.
Test setting thread name. No asserts possible.
Test running MaybeYield(). No obvious more complex test case.
Test running SyncMemory(). No obvious more complex test case.
Check TracerPid in /proc/self/status for attached debugger.
Add SIGTRAP handler to prevent signal from halting app while not running
in a debugger.
Log DebugPrint in clog (stderr).
Remove custom platform implementation of `DeleteFile` and replace single
use with `std::filesystem::remove` after a negative
`std::filesystem::is_directory` check.
Remove custom platform implementation of `DeleteFolder` and replace two
uses with `std::filesystem::remove_all` which removes a file or
directory with all its contents.
C++17ification!
- Filesystem interaction now uses std::filesystem::path.
- Usage of const char*, std::string have been changed to
std::string_view where appropriate.
- Usage of printf-style functions changed to use fmt.
All instances of kMaxPath or MAX_PATH being used have been removed,
and removing this constant is supposed to encourage writing code
without artificial constraints on path length.
In the 'OpenExisting' function, 'open_access' is used to create the flags for opening the file.
However, it is not set to zero, so could end up being incorrect file modes, potentially even emptying the file for appending, which would be bad.
This simply initialises it to zero first.
New cvar clock_source_raw allows to use the cpu cycle counter itself as an alternative time source, if system timing resolution is to low and causes problems.
- Removed tick and time values from ThreadSavedState.
- Removed affiliated get/set code from Save and Restore.
- Removed dangerous SetGuestTickCount method.