2022-10-25 18:33:12 +03:00
|
|
|
package redsync_test
|
|
|
|
|
2022-10-25 18:48:22 +03:00
|
|
|
import "git.bit5.ru/backend/redsync"
|
2022-10-25 18:33:12 +03:00
|
|
|
|
|
|
|
func ExampleMutex() {
|
|
|
|
m, err := redsync.NewMutexWithGenericPool("FlyingSquirrels", pools)
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
|
|
|
|
err = m.Lock()
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
defer m.Unlock()
|
|
|
|
|
|
|
|
// Output:
|
|
|
|
}
|