19 #ifndef GRPC_INTERNAL_CPP_THREAD_MANAGER_H
20 #define GRPC_INTERNAL_CPP_THREAD_MANAGER_H
36 int min_pollers,
int max_pollers);
76 virtual void DoWork(
void* tag,
bool ok,
bool resources) = 0;
125 bool created()
const {
return created_; }
126 void Start() { thd_.Start(); }
141 void MarkAsCompleted(WorkerThread* thd);
142 void CleanupCompletedThreads();
173 int max_active_threads_sofar_;
176 std::list<WorkerThread*> completed_threads_;
Definition: thread_manager.h:33
virtual void Shutdown()
Definition: thread_manager.cc:82
ThreadManager(const char *name, grpc_resource_quota *resource_quota, int min_pollers, int max_pollers)
Definition: thread_manager.cc:52
int GetMaxActiveThreadsSoFar()
Definition: thread_manager.cc:92
WorkStatus
Definition: thread_manager.h:43
@ TIMEOUT
Definition: thread_manager.h:43
@ WORK_FOUND
Definition: thread_manager.h:43
@ SHUTDOWN
Definition: thread_manager.h:43
virtual ~ThreadManager()
Definition: thread_manager.cc:64
void Initialize()
Definition: thread_manager.cc:126
virtual void DoWork(void *tag, bool ok, bool resources)=0
virtual WorkStatus PollForWork(void **tag, bool *ok)=0
virtual void Wait()
Definition: thread_manager.cc:75
bool IsShutdown()
Definition: thread_manager.cc:87
An Alarm posts the user-provided tag to its associated completion queue or invokes the user-provided ...
Definition: alarm.h:33
Definition: resource_quota.cc:127
Definition: resource_quota.cc:65