Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for opsID (0.14 sec)

  1. cmd/namespace-lock.go

    	}
    	nsLk.ref++
    	n.lockMap[resource] = nsLk
    	n.lockMapMutex.Unlock()
    
    	// Locking here will block (until timeout).
    	if readLock {
    		locked = nsLk.GetRLock(ctx, opsID, lockSource, timeout)
    	} else {
    		locked = nsLk.GetLock(ctx, opsID, lockSource, timeout)
    	}
    
    	if !locked { // We failed to get the lock
    		// Decrement ref count since we failed to get the lock
    		n.lockMapMutex.Lock()
    		n.lockMap[resource].ref--
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Jun 05 23:56:35 GMT 2023
    - 9.2K bytes
    - Viewed (0)
  2. cmd/namespace-lock_test.go

    		nsLk := newNSLock(false)
    
    		// lk1; ref=1
    		if !nsLk.lock(ctx, "volume", "path", "source", "opsID", false, time.Second) {
    			t.Fatal("failed to acquire lock")
    		}
    
    		// lk2
    		lk2ch := make(chan struct{})
    		go func() {
    			defer close(lk2ch)
    			nsLk.lock(ctx, "volume", "path", "source", "opsID", false, 1*time.Millisecond)
    		}()
    		time.Sleep(1 * time.Millisecond) // wait for goroutine to advance; ref=2
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 3.1K bytes
    - Viewed (0)
Back to top