Implement basic network flow control (#2803)
Co-authored-by: Cameron Gutman <aicommander@gmail.com>
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
|
||||
#include <boost/core/noncopyable.hpp>
|
||||
|
||||
#include "src/config.h"
|
||||
#include "src/logging.h"
|
||||
#include "src/stat_trackers.h"
|
||||
@@ -799,4 +801,30 @@ namespace platf {
|
||||
*/
|
||||
std::vector<supported_gamepad_t> &
|
||||
supported_gamepads(input_t *input);
|
||||
|
||||
struct high_precision_timer: private boost::noncopyable {
|
||||
virtual ~high_precision_timer() = default;
|
||||
|
||||
/**
|
||||
* @brief Sleep for the duration
|
||||
* @param duration Sleep duration
|
||||
*/
|
||||
virtual void
|
||||
sleep_for(const std::chrono::nanoseconds &duration) = 0;
|
||||
|
||||
/**
|
||||
* @brief Check if platform-specific timer backend has been initialized successfully
|
||||
* @return `true` on success, `false` on error
|
||||
*/
|
||||
virtual
|
||||
operator bool() = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Create platform-specific timer capable of high-precision sleep
|
||||
* @return A unique pointer to timer
|
||||
*/
|
||||
std::unique_ptr<high_precision_timer>
|
||||
create_high_precision_timer();
|
||||
|
||||
} // namespace platf
|
||||
|
||||
Reference in New Issue
Block a user