Implementations for Windows and macOS should be fairly similar, but using the OS' message loop instad of a thread.