【发布时间】:2017-09-29 12:25:10
【问题描述】:
有两个线程,一个在CompletionQueue上调用shutdown
debug_log("cq shutdown start\n");
cq.Shutdown();
debug_log("cq shutdown success\n");
在另一个线程中,cq.next 永远被阻止。
我可以看到 cq 中有一个待处理的事件, 但是从文档中我希望一旦我调用shutdown,cq.next 将开始返回false。
我不知道这里出了什么问题。
这是 cq.next 的调用堆栈
grpc_iocp_work(grpc_exec_ctx * exec_ctx, gpr_timespec deadline) Line 83 C
grpc_pollset_work(grpc_exec_ctx * exec_ctx, grpc_pollset * pollset, grpc_pollset_worker * * worker_hdl, gpr_timespec now, gpr_timespec deadline) Line 143 C
cq_next(grpc_completion_queue * cc, gpr_timespec deadline, void * reserved) Line 844 C
grpc_completion_queue_next(grpc_completion_queue * cc, gpr_timespec deadline, void * reserved) Line 873 C
grpc::CompletionQueue::AsyncNextInternal(void * * tag, bool * ok, gpr_timespec deadline) Line 71 C++
grpc::CompletionQueue::Next(void * * tag, bool * ok) Line 151 C++
【问题讨论】: