import "github.com/ooopSnake/timed_mutex"
acquire a lock,block until lock obtained
release lock
try acquire a lock, true
if lock obtained otherwise return false
immediately.
try acquire a lock in specified duration, true
if lock obtained.
return false
if the mutex still unavailable until specified time point has been reached.
init lock 😏
locker := timed_mutex.New()
unlock 😐
locker.UnLock()
direct lock 😐
locker.Lock()
trylock 😎
locked := locker.TryLock()
trylock with timeout 😎
locked := locker.TryLockTimeout(time.Second*5)
Released under the MIT License