Documentation
¶
Overview ¶
Example ¶
package main
import (
"fmt"
"github.com/LK4D4/trylock"
)
func main() {
var mu trylock.Mutex
fmt.Println(mu.TryLock())
fmt.Println(mu.TryLock())
mu.Unlock()
fmt.Println(mu.TryLock())
}
Output: true false true
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Mutex is simple sync.Mutex + ability to try to Lock.
func (*Mutex) Lock ¶
func (m *Mutex) Lock()
Lock locks m. If the lock is already in use, the calling goroutine blocks until the mutex is available.
Click to show internal directories.
Click to hide internal directories.