26 #ifndef PAGESPEED_KERNEL_BASE_NULL_THREAD_SYSTEM_H_
27 #define PAGESPEED_KERNEL_BASE_NULL_THREAD_SYSTEM_H_
29 #include "base/logging.h"
36 namespace net_instaweb {
43 : mutex_(m), timed_wait_callback_(NULL) {}
46 virtual void Signal() { actions_.push_back(
"Signal()"); }
47 virtual void Broadcast() { actions_.push_back(
"Broadcast()"); }
48 virtual void Wait() { actions_.push_back(
"Wait()"); }
55 virtual void Call() = 0;
61 CHECK(timed_wait_callback_ == NULL);
62 timed_wait_callback_ = x;
67 StringVector actions_;
68 TimedWaitCallback* timed_wait_callback_;
102 int current_thread()
const {
return thread_id_; }
105 virtual ThreadImpl* NewThreadImpl(Thread* wrapper, ThreadFlags flags);
virtual void TimedWait(int64 timeout_ms)
virtual bool TryLock()
Attempt to take mutex, true on success, false if held by another thread.
Definition: null_thread_system.h:79
virtual NullCondvarCapableMutex * NewMutex()
void set_current_thread(int id)
Provide injection/observation of current thread IDs.
Definition: null_thread_system.h:101
virtual void Lock()
Block until mutex is available, then take the mutex.
Definition: null_thread_system.h:80
virtual void Wait()
Definition: null_thread_system.h:48
virtual Timer * NewTimer()
Definition: thread_system.h:46
virtual ThreadSystem::CondvarCapableMutex * mutex() const
Return the mutex associated with this condition variable.
Definition: null_thread_system.h:45
void set_timed_wait_callback(TimedWaitCallback *x)
Definition: null_thread_system.h:60
std::string GoogleString
PAGESPEED_KERNEL_BASE_STRING_H_.
Definition: string.h:24
Definition: thread_system.h:61
Definition: null_thread_system.h:40
Definition: null_thread_system.h:52
Definition: thread_system.h:40
virtual RWLock * NewRWLock()
Definition: null_thread_system.h:75
virtual void Unlock()
Release the mutex, permitting a blocked lock operation (if any) to proceed.
Definition: null_thread_system.h:81
virtual void Broadcast()
Definition: null_thread_system.h:47
Definition: thread_system.h:116
virtual void Signal()
Definition: null_thread_system.h:46
Timer interface, made virtual so it can be mocked for tests.
Definition: timer.h:27
Definition: null_thread_system.h:91
virtual NullCondvar * NewCondvar()
Creates a new condition variable associated with 'this' mutex.
virtual ThreadId * GetThreadId() const