Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestMutex (0.14 sec)

  1. internal/dsync/dsync_test.go

    func HammerMutex(m *DRWMutex, loops int, cdone chan bool) {
    	for range loops {
    		m.Lock(id, source)
    		m.Unlock(context.Background())
    	}
    	cdone <- true
    }
    
    // Borrowed from mutex_test.go
    func TestMutex(t *testing.T) {
    	loops := 200
    	if testing.Short() {
    		loops = 5
    	}
    	c := make(chan bool)
    	m := NewDRWMutex(ds, "test")
    	for range 10 {
    		go HammerMutex(m, loops, c)
    	}
    	for range 10 {
    		<-c
    Registered: Sun Dec 28 19:28:13 UTC 2025
    - Last Modified: Fri Aug 29 02:39:48 UTC 2025
    - 10.8K bytes
    - Viewed (0)
Back to top