Documentation ¶
Index ¶
- func BytesHash64(b []byte) int64
- func Fatal(args ...interface{})
- func Fatalf(format string, args ...interface{})
- func Hash64(n int64) int64
- func RandBytes(r *rand.Rand, b []byte)
- func Slice(s string) (b []byte)
- func String(b []byte) (s string)
- func StringHash64(s string) int64
- type BufPool
- type SpinLock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Fatalf ¶
func Fatalf(format string, args ...interface{})
Fatalf prints the message and exits the program.
Types ¶
type BufPool ¶
type BufPool struct {
// contains filtered or unexported fields
}
BufPool is a bytes.Buffer pool
type SpinLock ¶
type SpinLock struct {
// contains filtered or unexported fields
}
SpinLock implements a simple atomic spin lock, the zero value for a SpinLock is an unlocked spinlock.
func (*SpinLock) Lock ¶
func (sl *SpinLock) Lock()
Lock locks sl. If the lock is already in use, the caller blocks until Unlock is called
func (*SpinLock) TryLock ¶
TryLock will try to lock sl and return whether it succeed or not without blocking.
func (*SpinLock) Unlock ¶
func (sl *SpinLock) Unlock()
Unlock unlocks sl, unlike [Mutex.Unlock](http://golang.org/pkg/sync/#Mutex.Unlock), there's no harm calling it on an unlocked SpinLock
Click to show internal directories.
Click to hide internal directories.