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

  • 相关阅读:
    Mermaid | 强大的画图渲染脚本
    Tools | windows剪切板增强版
    Eclipse | eclipse食用教程
    WebSites | 常用工具网站
    Extensions | Extension && Plugins
    Java | IDE-Eclipse下载安装
    敲个采药玩玩
    今日sb题之 sdnuoj 1064
    stl概述
    给定 n 个字符串,求有多少字符串是其他字符串的前缀。
  • 原文地址:https://www.cnblogs.com/rsapaper/p/15719247.html
Copyright © 2011-2022 走看看