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

  • 相关阅读:
    SpringBoot+SpringCloud
    bootstrap-thymeleaf-分页
    排序-Java
    native2ascii运用
    标准W3C盒子模型和IE盒子模型
    在既定状态下截图
    java.util.zip.ZipException: error in opening zip file
    安装 haproxy
    mysql集群
    最简redis集群配置
  • 原文地址:https://www.cnblogs.com/rsapaper/p/15719247.html
Copyright © 2011-2022 走看看