• 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

  • 相关阅读:
    pycharm使用
    python上手之环境搭建
    LDA浅析转
    矩阵按列按行归一化到L2范数的原理和最精简Matlab代码(转)
    (转)Low-Mid-High
    菲波纳数列的特性
    劝狼赋
    asp.net mvc Controller 模式下的 aop
    android for vs (三)visual studio android 发布为 apk
    android for vs (二)visual studio android 开发实例
  • 原文地址:https://www.cnblogs.com/rsapaper/p/15719247.html
Copyright © 2020-2023  润新知