Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for NewLRWMutex (0.17 sec)

  1. internal/lsync/lrwmutex_test.go

    			t.Fatalf("unlock of unlocked RWMutex did not panic")
    		}
    	}()
    	mu := NewLRWMutex()
    	mu.Unlock()
    }
    
    // Borrowed from rwmutex_test.go
    func TestUnlockPanic2(t *testing.T) {
    	defer func() {
    		if recover() == nil {
    			t.Fatalf("unlock of unlocked RWMutex did not panic")
    		}
    	}()
    	mu := NewLRWMutex()
    	mu.RLock()
    	mu.Unlock()
    }
    
    // Borrowed from rwmutex_test.go
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Mar 05 04:57:35 GMT 2023
    - 7.9K bytes
    - Viewed (0)
  2. internal/lsync/lrwmutex.go

    type LRWMutex struct {
    	id          string
    	source      string
    	isWriteLock bool
    	ref         int
    	mu          sync.Mutex // Mutex to prevent multiple simultaneous locks
    }
    
    // NewLRWMutex - initializes a new lsync RW mutex.
    func NewLRWMutex() *LRWMutex {
    	return &LRWMutex{}
    }
    
    // Lock holds a write lock on lm.
    //
    // If the lock is already in use, the calling go routine
    // blocks until the mutex is available.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 4.8K bytes
    - Viewed (0)
  3. cmd/namespace-lock.go

    	resource := pathJoin(volume, path)
    
    	n.lockMapMutex.Lock()
    	nsLk, found := n.lockMap[resource]
    	if !found {
    		nsLk = &nsLock{
    			LRWMutex: lsync.NewLRWMutex(),
    		}
    		// Add a count to indicate that a parallel unlock doesn't clear this entry.
    	}
    	nsLk.ref++
    	n.lockMap[resource] = nsLk
    	n.lockMapMutex.Unlock()
    
    	// Locking here will block (until timeout).
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Jun 05 23:56:35 GMT 2023
    - 9.2K bytes
    - Viewed (0)
Back to top