Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 86 for Unlock (0.18 sec)

  1. cmd/namespace-lock.go

    	}
    	timeout.LogSuccess(UTCNow().Sub(start))
    	return LockContext{ctx: newCtx, cancel: cancel}, nil
    }
    
    // Unlock - block until write lock is released.
    func (di *distLockInstance) Unlock(lc LockContext) {
    	if lc.cancel != nil {
    		lc.cancel()
    	}
    	di.rwMutex.Unlock(lc.ctx)
    }
    
    // RLock - block until read lock is taken or timeout has occurred.
    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)
  2. cmd/lock-rest-client.go

    	}
    	return ok, err
    }
    
    // RLock calls read lock REST API.
    func (c *lockRESTClient) RLock(ctx context.Context, args dsync.LockArgs) (reply bool, err error) {
    	return c.call(ctx, lockRPCRLock, &args)
    }
    
    // Lock calls lock REST API.
    func (c *lockRESTClient) Lock(ctx context.Context, args dsync.LockArgs) (reply bool, err error) {
    	return c.call(ctx, lockRPCLock, &args)
    }
    
    // RUnlock calls read unlock REST API.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Nov 24 17:07:14 GMT 2023
    - 3.3K bytes
    - Viewed (0)
  3. internal/lock/lock.go

    	*LockedFile
    	mutex sync.Mutex
    	refs  int // Holds read lock refs.
    }
    
    // IsClosed - Check if the rlocked file is already closed.
    func (r *RLockedFile) IsClosed() bool {
    	r.mutex.Lock()
    	defer r.mutex.Unlock()
    	return r.refs == 0
    }
    
    // IncLockRef - is used by called to indicate lock refs.
    func (r *RLockedFile) IncLockRef() {
    	r.mutex.Lock()
    	r.refs++
    	r.mutex.Unlock()
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  4. internal/dsync/locker.go

    	// Do read unlock for given LockArgs. It should return
    	// * a boolean to indicate success/failure of the operation
    	// * an error on failure of unlock request operation.
    	// Canceling the context will abort the remote call.
    	// In that case, the resource may or may not be unlocked.
    	RUnlock(ctx context.Context, args LockArgs) (bool, error)
    
    	// Do write unlock for given LockArgs. It should return
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Jan 18 20:44:38 GMT 2022
    - 2.7K bytes
    - Viewed (0)
  5. prepare_stmt.go

    	}
    
    	return nil, ErrInvalidDB
    }
    
    func (db *PreparedStmtDB) Close() {
    	db.Mux.Lock()
    	defer db.Mux.Unlock()
    
    	for _, query := range db.PreparedSQL {
    		if stmt, ok := db.Stmts[query]; ok {
    			delete(db.Stmts, query)
    			go stmt.Close()
    		}
    	}
    }
    
    func (sdb *PreparedStmtDB) Reset() {
    	sdb.Mux.Lock()
    	defer sdb.Mux.Unlock()
    
    	for _, stmt := range sdb.Stmts {
    		go stmt.Close()
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  6. cmd/namespace-lock_test.go

    		// 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
    
    		// Unlock the 1st lock; ref=1 after this line
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 3.1K bytes
    - Viewed (0)
  7. internal/dsync/drwmutex_test.go

    	mu := NewDRWMutex(ds, "test-runlock-panic-2")
    	defer func() {
    		if recover() == nil {
    			t.Fatalf("read unlock of unlocked RWMutex did not panic")
    		}
    		mu.Unlock(context.Background()) // Unlock, so -test.count > 1 works
    	}()
    	mu.Lock(id, source)
    	mu.RUnlock(context.Background())
    }
    
    // Borrowed from rwmutex_test.go
    func benchmarkRWMutex(b *testing.B, localWork, writeRatio int) {
    	b.ResetTimer()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 24 03:49:07 GMT 2022
    - 9.7K bytes
    - Viewed (0)
  8. internal/lsync/lrwmutex_test.go

    		}
    	}()
    	mu := NewLRWMutex()
    	mu.RLock()
    	mu.Unlock()
    }
    
    // Borrowed from rwmutex_test.go
    func TestRUnlockPanic(t *testing.T) {
    	defer func() {
    		if recover() == nil {
    			t.Fatalf("read unlock of unlocked RWMutex did not panic")
    		}
    	}()
    	mu := NewLRWMutex()
    	mu.RUnlock()
    }
    
    // Borrowed from rwmutex_test.go
    func TestRUnlockPanic2(t *testing.T) {
    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)
  9. cmd/metacache-manager.go

    	m.init.Do(m.initManager)
    	m.mu.Lock()
    	b, ok := m.buckets[bucket]
    	if !ok {
    		m.mu.Unlock()
    		return
    	}
    	delete(m.buckets, bucket)
    	m.mu.Unlock()
    
    	// Since deletes may take some time we try to do it without
    	// holding lock to m all the time.
    	b.mu.Lock()
    	defer b.mu.Unlock()
    	for k, v := range b.caches {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Oct 25 00:44:15 GMT 2022
    - 5.2K bytes
    - Viewed (0)
  10. internal/bucket/bandwidth/monitor.go

    			return
    		}
    	}
    }
    
    func (m *Monitor) updateMovingAvg() {
    	m.mlock.Lock()
    	defer m.mlock.Unlock()
    	for _, bucketMeasurement := range m.bucketsMeasurement {
    		bucketMeasurement.updateExponentialMovingAverage(time.Now())
    	}
    }
    
    func (m *Monitor) init(opts BucketOptions) {
    	m.mlock.Lock()
    	defer m.mlock.Unlock()
    
    	_, ok := m.bucketsMeasurement[opts]
    	if !ok {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 6K bytes
    - Viewed (0)
Back to top