Documentation ¶
Index ¶
- Variables
- func BasicTest[Connection any](t *testing.T, factory *storage_lock_factory.StorageLockFactory[Connection])
- func ConcurrencyTest[Connection any](t *testing.T, factory *storage_lock_factory.StorageLockFactory[Connection])
- func TestStorageLock[Connection any](t *testing.T, factory *storage_lock_factory.StorageLockFactory[Connection])
- type Counter
- type LockPlayer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PlayerNum 有多少个人参与 PlayerNum = 100 // EveryOnePlayTimes 参与的每个人都操作多少次 EveryOnePlayTimes = 100 )
Functions ¶
func BasicTest ¶
func BasicTest[Connection any](t *testing.T, factory *storage_lock_factory.StorageLockFactory[Connection])
BasicTest 锁的基本功能测试
func ConcurrencyTest ¶
func ConcurrencyTest[Connection any](t *testing.T, factory *storage_lock_factory.StorageLockFactory[Connection])
ConcurrencyTest 并发测试
func TestStorageLock ¶
func TestStorageLock[Connection any](t *testing.T, factory *storage_lock_factory.StorageLockFactory[Connection])
TestStorageLock 测试锁
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter 计数器
func NewCounter ¶
func NewCounter() *Counter
type LockPlayer ¶
type LockPlayer[Connection any] struct { // contains filtered or unexported fields }
LockPlayer 竞争锁的人
func NewLockPlayer ¶
func NewLockPlayer[Connection any](lockId string, factory *storage_lock_factory.StorageLockFactory[Connection]) (*LockPlayer[Connection], error)
Click to show internal directories.
Click to hide internal directories.