zoukankan      html  css  js  c++  java
  • Cond


    package sync

    import (
    "sync/atomic"
    "unsafe"
    )

    // Cond implements a condition variable, a rendezvous point
    // for goroutines waiting for or announcing the occurrence
    // of an event.
    //
    // Each Cond has an associated Locker L (often a *Mutex or *RWMutex),
    // which must be held when changing the condition and
    // when calling the Wait method.
    //
    // A Cond must not be copied after first use.
    type Cond struct {
    noCopy noCopy

    // L is held while observing or changing the condition
    L Locker

    notify notifyList
    checker copyChecker
    }

    // NewCond returns a new Cond with Locker l.
    func NewCond(l Locker) *Cond {
    return &Cond{L: l}
    }

    Go/src/sync/cond.go:5

    // Server is a gRPC server to serve RPC requests.
    type Server struct {
    opts serverOptions

    mu sync.Mutex // guards following
    lis map[net.Listener]bool
    // conns contains all active server transports. It is a map keyed on a
    // listener address with the value being the set of active transports
    // belonging to that listener.
    conns map[string]map[transport.ServerTransport]bool
    serve bool
    drain bool
    cv *sync.Cond // signaled when connections close for GracefulStop
    services map[string]*serviceInfo // service name -> service info
    events trace.EventLog

    quit *grpcsync.Event
    done *grpcsync.Event
    channelzRemoveOnce sync.Once
    serveWG sync.WaitGroup // counts active Serve goroutines for GracefulStop

    channelzID int64 // channelz unique identification number
    czData *channelzData

    serverWorkerChannels []chan *serverWorkerData
    }

    google.golang.org/grpc@v1.43.0/server.go:128

  • 相关阅读:
    window C/C++ 简单的IDE编译器
    ubuntu 安装 lamp
    架构设计
    linux 性能分析
    wifi基本原理
    openwrt 编译
    学习笔记day5:inline inline-block block区别
    脱离原来文档流产生浮动框
    meta标签清理缓存
    百度web前端面试2015.10.18
  • 原文地址:https://www.cnblogs.com/rsapaper/p/15719247.html
Copyright © 2011-2022 走看看