github.com/SagerNet/gvisor@v0.0.0-20210707092255-7731c139d75c/pkg/sync/aliases.go (about)

     1  // Copyright 2020 The gVisor Authors.
     2  //
     3  // Use of this source code is governed by a BSD-style
     4  // license that can be found in the LICENSE file.
     5  
     6  package sync
     7  
     8  import (
     9  	"sync"
    10  )
    11  
    12  // Aliases of standard library types.
    13  type (
    14  	// Cond is an alias of sync.Cond.
    15  	Cond = sync.Cond
    16  
    17  	// Locker is an alias of sync.Locker.
    18  	Locker = sync.Locker
    19  
    20  	// Once is an alias of sync.Once.
    21  	Once = sync.Once
    22  
    23  	// Pool is an alias of sync.Pool.
    24  	Pool = sync.Pool
    25  
    26  	// WaitGroup is an alias of sync.WaitGroup.
    27  	WaitGroup = sync.WaitGroup
    28  
    29  	// Map is an alias of sync.Map.
    30  	Map = sync.Map
    31  )
    32  
    33  // NewCond is a wrapper around sync.NewCond.
    34  func NewCond(l Locker) *Cond {
    35  	return sync.NewCond(l)
    36  }