github.com/sitano/gsysint@v0.0.0-20190607084937-69a4f3233e4e/mutex.go (about)

     1  package gsysint
     2  
     3  import (
     4  	_ "unsafe"
     5  
     6  	"github.com/sitano/gsysint/g"
     7  )
     8  
     9  // Mutual exclusion locks.  In the uncontended case,
    10  // as fast as spin locks (just a few user-level instructions),
    11  // but on the contention path they sleep in the kernel.
    12  // A zeroed Mutex is unlocked (no need to initialize each lock).
    13  type Mutex = g.Mutex
    14  
    15  func Lock(l *Mutex) {
    16  	g.Lock(l)
    17  }
    18  
    19  func Unlock(l *Mutex) {
    20  	g.Unlock(l)
    21  }