34 #ifndef GRPC_INTERNAL_CPP_SERVER_THREAD_POOL_H
35 #define GRPC_INTERNAL_CPP_SERVER_THREAD_POOL_H
37 #include <grpc++/config.h>
39 #include <grpc++/impl/sync.h>
40 #include <grpc++/impl/thd.h>
41 #include <grpc++/thread_pool_interface.h>
48 class ThreadPool
GRPC_FINAL :
public ThreadPoolInterface {
50 explicit ThreadPool(
int num_threads);
53 void ScheduleCallback(
const std::function<
void()>& callback) GRPC_OVERRIDE;
57 grpc::condition_variable cv_;
59 std::queue<std::function<
void()>> callbacks_;
60 std::vector<grpc::thread> threads_;
67 #endif // GRPC_INTERNAL_CPP_SERVER_THREAD_POOL_H
Definition: proto_utils.cc:45