Source release 19.4.0

This commit is contained in:
Vicky Min
2024-11-27 00:07:23 +00:00
parent 11c108a8da
commit 22759672a8
72 changed files with 5321 additions and 2622 deletions

View File

@@ -9,6 +9,8 @@
#include <stdint.h>
#include <unordered_set>
namespace wvutil {
class TestSleep {
@@ -67,13 +69,18 @@ class TestSleep {
static bool real_sleep() { return real_sleep_; }
// The callback is notified whenever sleep is called.
static void set_callback(CallBack* callback) { callback_ = callback; }
static void AddCallback(CallBack* callback) {
callbacks_.insert(callback);
}
static void RemoveCallback(CallBack* callback) {
callbacks_.erase(callback);
}
private:
// Controls if the test sleep should use real sleep.
static bool real_sleep_;
// Called when the clock should advance.
static CallBack* callback_;
static std::unordered_set<CallBack*> callbacks_;
// The sum of all calls to RollBackSystemTime. Kept so we can undo all changes
// at the end of a test.
static int total_clock_rollback_seconds_;