提交 8e0a7bfb 编写于 作者: X xiefangqi

fix tfreader WaitPost register failed

上级 42047764
...@@ -238,6 +238,9 @@ Status TFReaderOp::CalculateNumRowsPerShard() { ...@@ -238,6 +238,9 @@ Status TFReaderOp::CalculateNumRowsPerShard() {
Status TFReaderOp::operator()() { Status TFReaderOp::operator()() {
RETURN_IF_NOT_OK(CalculateNumRowsPerShard()); RETURN_IF_NOT_OK(CalculateNumRowsPerShard());
// Put here to avoid register failed when Worker_Entry thread exits unexpected
RETURN_IF_NOT_OK(io_block_queue_wait_post_.Register(tree_->AllTasks()));
// launch one thread, responsible for filling mIOBlockQueue // launch one thread, responsible for filling mIOBlockQueue
RETURN_IF_NOT_OK(tree_->LaunchWorkers(1, std::bind(&TFReaderOp::WaitToFillIOBlockQueue, this))); RETURN_IF_NOT_OK(tree_->LaunchWorkers(1, std::bind(&TFReaderOp::WaitToFillIOBlockQueue, this)));
...@@ -250,8 +253,6 @@ Status TFReaderOp::operator()() { ...@@ -250,8 +253,6 @@ Status TFReaderOp::operator()() {
// so workers have to be kept alive until the end of the program // so workers have to be kept alive until the end of the program
TaskManager::FindMe()->Post(); TaskManager::FindMe()->Post();
RETURN_IF_NOT_OK(io_block_queue_wait_post_.Register(tree_->AllTasks()));
NotifyToFillIOBlockQueue(); NotifyToFillIOBlockQueue();
while (!finished_reading_dataset_) { while (!finished_reading_dataset_) {
int64_t buffer_id = 0; int64_t buffer_id = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册