Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 167 for Unlock (0.17 sec)

  1. internal/lsync/lrwmutex.go

    	}
    }
    
    // RUnlock releases a read lock held on lm.
    //
    // It is a run-time error if lm is not locked on entry to RUnlock.
    func (lm *LRWMutex) RUnlock() {
    	isWriteLock := false
    	success := lm.unlock(isWriteLock)
    	if !success {
    		panic("Trying to RUnlock() while no RLock() is active")
    	}
    }
    
    func (lm *LRWMutex) unlock(isWriteLock bool) (unlocked bool) {
    	lm.mu.Lock()
    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)
  2. internal/dsync/drwmutex.go

    }
    
    // Unlock unlocks the write lock.
    //
    // It is a run-time error if dm is not locked on entry to Unlock.
    func (dm *DRWMutex) Unlock(ctx context.Context) {
    	dm.m.Lock()
    	dm.cancelRefresh()
    	dm.m.Unlock()
    
    	restClnts, owner := dm.clnt.GetLockers()
    	// create temp array on stack
    	locks := make([]string, len(restClnts))
    
    	{
    		dm.m.Lock()
    		defer dm.m.Unlock()
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  3. 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)
  4. internal/dsync/dsync-server_test.go

    	return reply, nil
    }
    
    func (l *lockServer) Unlock(args *LockArgs) (reply bool, err error) {
    	if d := atomic.LoadInt64(&l.responseDelay); d != 0 {
    		time.Sleep(time.Duration(d))
    	}
    
    	l.mutex.Lock()
    	defer l.mutex.Unlock()
    	var locksHeld int64
    	if locksHeld, reply = l.lockMap[args.Resources[0]]; !reply { // No lock is held on the given name
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Jan 23 16:46:37 GMT 2023
    - 8.3K 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 21 09:35:09 GMT 2024
    - Last Modified: Thu Mar 28 08:47:39 GMT 2024
    - 6.4K bytes
    - Viewed (0)
  6. cmd/local-locker.go

    }
    
    func (l *localLocker) RUnlock(_ context.Context, args dsync.LockArgs) (reply bool, err error) {
    	if len(args.Resources) > 1 {
    		return false, fmt.Errorf("internal error: localLocker.RUnlock called with more than one resource")
    	}
    
    	l.mutex.Lock()
    	defer l.mutex.Unlock()
    	var lri []lockRequesterInfo
    
    	resource := args.Resources[0]
    	if lri, reply = l.lockMap[resource]; !reply {
    		// No lock is held on the given name
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  7. internal/event/targetlist.go

    	list.statLock.Lock()
    	defer list.statLock.Unlock()
    
    	stats, ok := list.targetStats[id]
    	if !ok {
    		// should not happen
    		return
    	}
    
    	stats.currentSendCalls--
    	list.targetStats[id] = stats
    	return
    }
    
    func (list *TargetList) incFailedEvents(id TargetID) {
    	list.statLock.Lock()
    	defer list.statLock.Unlock()
    
    	stats, ok := list.targetStats[id]
    	if !ok {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  8. internal/store/batch.go

    func (b *Batch[K, T]) GetByKey(key K) (T, bool) {
    	b.Lock()
    	defer b.Unlock()
    
    	item, ok := b.items[key]
    	return item, ok
    }
    
    // Len returns the no of items in the batch
    func (b *Batch[K, T]) Len() int {
    	b.Lock()
    	defer b.Unlock()
    
    	return len(b.keys)
    }
    
    // IsFull checks if the batch is full or not
    func (b *Batch[K, T]) IsFull() bool {
    	b.Lock()
    	defer b.Unlock()
    
    	return b.isFull()
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Oct 07 15:07:38 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top