Standard library / sync

sync.RWMutex.Unlock()

Release an acquired write lock. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (rw *RWMutex) Unlock()

Working Example

Example Snippetgo
package main
import (  "fmt"  "sync")
func main() {  var m sync.RWMutex  m.Lock()  m.Unlock()  ok := m.TryRLock()  fmt.Println(ok)  if ok {    m.RUnlock()  }}
Go Reference