19 #ifndef PAGESPEED_KERNEL_THREAD_MOCK_SCHEDULER_H_
20 #define PAGESPEED_KERNEL_THREAD_MOCK_SCHEDULER_H_
23 #include "pagespeed/kernel/base/thread_annotations.h"
29 namespace net_instaweb {
46 LOCKS_EXCLUDED(mutex());
48 LOCKS_EXCLUDED(mutex());
55 AdvanceTimeUs(timeout_ms * Timer::kMsUs);
57 void AdvanceTimeUs(int64 timeout_us) LOCKS_EXCLUDED(mutex());
60 void SetTimeUs(int64 time_us) LOCKS_EXCLUDED(mutex());
64 EXCLUSIVE_LOCKS_REQUIRED(mutex());
67 inline void SetTimeUsMutexHeld(int64 time_us)
68 EXCLUSIVE_LOCKS_REQUIRED(mutex());
73 QueuedWorkerPool::SequenceSet workers_ GUARDED_BY(mutex());
Definition: mock_timer.h:33
Definition: mock_scheduler.h:39
virtual void RegisterWorker(QueuedWorkerPool::Sequence *w) LOCKS_EXCLUDED(mutex())
void SetTimeUs(int64 time_us) LOCKS_EXCLUDED(mutex())
Sets the current absolute time using absolute numbers.
Timer * timer()
Definition: scheduler.h:154
void AdvanceTimeMs(int64 timeout_ms) LOCKS_EXCLUDED(mutex())
Similar to BlockingTimedWaitUs but takes the lock for convenience.
Definition: mock_scheduler.h:54
Definition: queued_worker_pool.h:65
virtual void AwaitWakeupUntilUs(int64 wakeup_time_us) EXCLUSIVE_LOCKS_REQUIRED(mutex())
Definition: thread_system.h:40
Definition: scheduler.h:47
ThreadSystem * thread_system()
Obtain the thread system used by the scheduler.
Definition: scheduler.h:157
void AwaitQuiescence() LOCKS_EXCLUDED(mutex())
Blocks until all work in registered workers is done.