Golang sync.Cond type and NewCond() function example

package sync

Golang sync.Cond type and NewCond() function usage example

 package main

 import (
  "fmt"
  "sync"
 )

 func main() {

  var m sync.Mutex
  c := sync.NewCond(&m)

  fmt.Println(c)
  
  // for here you can use c with Signal(), Broadcast(), etc.

 }

Reference :

http://golang.org/pkg/sync/#Cond

Advertisement