1 // Copyright (c) 2020 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "quiche/quic/qbone/bonnet/qbone_tunnel_silo.h" 6 7 namespace quic { 8 Run()9void QboneTunnelSilo::Run() { 10 while (ShouldRun()) { 11 tunnel_->WaitForEvents(); 12 } 13 14 QUIC_LOG(INFO) << "Tunnel has disconnected in state: " 15 << tunnel_->StateToString(tunnel_->Disconnect()); 16 } 17 Quit()18void QboneTunnelSilo::Quit() { 19 QUIC_LOG(INFO) << "Quit called on QboneTunnelSilo"; 20 quitting_.Notify(); 21 tunnel_->Wake(); 22 } 23 ShouldRun()24bool QboneTunnelSilo::ShouldRun() { 25 bool post_init_shutdown_ready = 26 only_setup_tun_ && 27 tunnel_->state() == quic::QboneTunnelInterface::STARTED; 28 return !quitting_.HasBeenNotified() && !post_init_shutdown_ready; 29 } 30 31 } // namespace quic 32