Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 127 for Unlock (0.25 sec)

  1. internal/pubsub/pubsub.go

    	}
    	ps.Lock()
    	defer ps.Unlock()
    
    	sub := &Sub[T]{ch: subCh, types: Mask(mask.Mask()), filter: filter}
    	ps.subs = append(ps.subs, sub)
    
    	// We hold a lock, so we are safe to update
    	combined := Mask(atomic.LoadUint64(&ps.types))
    	combined.Merge(Mask(mask.Mask()))
    	atomic.StoreUint64(&ps.types, uint64(combined))
    
    	go func() {
    		<-doneCh
    
    		ps.Lock()
    		defer ps.Unlock()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Feb 06 16:57:30 GMT 2024
    - 5.2K bytes
    - Viewed (0)
  2. cmd/metacache-bucket.go

    		logger.Info("bucketMetacache.findCache: bucket %s does not match this bucket %s", o.Bucket, b.bucket)
    		debug.PrintStack()
    		return metacache{}
    	}
    
    	// Grab a write lock, since we create one if we cannot find one.
    	b.mu.Lock()
    	defer b.mu.Unlock()
    
    	// Check if exists already.
    	if c, ok := b.caches[o.ID]; ok {
    		c.lastHandout = time.Now()
    		b.caches[o.ID] = c
    		b.debugf("returning existing %v", o.ID)
    		return c
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6.6K bytes
    - Viewed (0)
  3. internal/lock/lock_test.go

    		t.Fatal("Unexpected error", err)
    	}
    }
    
    // Tests lock and unlock semantics.
    func TestLockAndUnlock(t *testing.T) {
    	f, err := os.CreateTemp("", "lock")
    	if err != nil {
    		t.Fatal(err)
    	}
    	f.Close()
    	defer func() {
    		err = os.Remove(f.Name())
    		if err != nil {
    			t.Fatal(err)
    		}
    	}()
    
    	// lock the file
    	l, err := LockedOpenFile(f.Name(), os.O_WRONLY, 0o600)
    	if err != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  4. internal/logger/logonce.go

    	if err == nil {
    		return
    	}
    
    	nerr := unwrapErrs(err)
    	l.Lock()
    	shouldLog := true
    	prev, ok := l.IDMap[id]
    	if !ok {
    		l.IDMap[id] = onceErr{
    			Err:   nerr,
    			Count: 1,
    		}
    	} else if prev.Err.Error() == nerr.Error() {
    		// if errors are equal do not log.
    		prev.Count++
    		l.IDMap[id] = prev
    		shouldLog = false
    	}
    	l.Unlock()
    
    	if shouldLog {
    		consoleLogIf(ctx, subsystem, err, errKind...)
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  5. cni/pkg/nodeagent/pod_cache.go

    func (p *podNetnsCache) Get(uid string) Netns {
    	// lock current snapshot pod map
    	p.mu.RLock()
    	defer p.mu.RUnlock()
    	if info, f := p.currentPodCache[uid]; f {
    		return info.Netns
    	}
    	return nil
    }
    
    // make sure uid is in the cache, even if we don't have a netns
    func (p *podNetnsCache) Ensure(uid string) {
    	p.mu.Lock()
    	defer p.mu.Unlock()
    	if _, ok := p.currentPodCache[uid]; !ok {
    Go
    - Registered: Wed May 01 22:53:12 GMT 2024
    - Last Modified: Fri Apr 12 21:47:31 GMT 2024
    - 4.5K bytes
    - Viewed (0)
  6. internal/cachevalue/cache.go

    		if t.updating.TryLock() {
    			go func() {
    				defer t.updating.Unlock()
    				t.update()
    			}()
    		}
    		return v.v, v.e
    	}
    
    	// Get lock. Either we get it or we wait for it.
    	t.updating.Lock()
    	if time.Since(time.UnixMilli(t.lastUpdateMs.Load())) < ttl {
    		// There is a new value, release lock and return it.
    		v = t.valErr.Load()
    		t.updating.Unlock()
    		return v.v, v.e
    	}
    	t.update()
    	v = t.valErr.Load()
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Mar 01 16:00:42 GMT 2024
    - 4.2K bytes
    - Viewed (0)
  7. guava-tests/benchmark/com/google/common/util/concurrent/CycleDetectingLockFactoryBenchmark.java

      }
    
      @Benchmark
      void unorderedCycleDetectingLocks(int reps) {
        lockAndUnlock(factory.newReentrantLock("foo"), reps);
      }
    
      private static void lockAndUnlock(Lock lock, int reps) {
        for (int i = 0; i < reps; i++) {
          lock.lock();
          lock.unlock();
        }
      }
    
      @Benchmark
      void orderedPlainLocks(int reps) {
        lockAndUnlockNested(plainLocks, reps);
      }
    
      @Benchmark
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 2.4K bytes
    - Viewed (0)
  8. tests/prepared_stmt_test.go

    	if !ok {
    		t.Fatalf("should assign PreparedStatement Manager back to database when using PrepareStmt mode")
    	}
    
    	pdb.Mux.Lock()
    	if len(pdb.Stmts) == 0 {
    		pdb.Mux.Unlock()
    		t.Fatalf("prepared stmt can not be empty")
    	}
    	pdb.Mux.Unlock()
    
    	pdb.Reset()
    	pdb.Mux.Lock()
    	defer pdb.Mux.Unlock()
    	if len(pdb.Stmts) != 0 {
    		t.Fatalf("prepared stmt should be empty")
    	}
    Go
    - Registered: Sun Apr 28 09:35:09 GMT 2024
    - Last Modified: Thu Mar 21 07:55:43 GMT 2024
    - 4K bytes
    - Viewed (0)
  9. internal/grid/muxserver.go

    }
    
    func (m *muxServer) send(msg message) {
    	m.sendMu.Lock()
    	defer m.sendMu.Unlock()
    	msg.MuxID = m.ID
    	msg.Seq = m.SendSeq
    	m.SendSeq++
    	if debugPrint {
    		fmt.Printf("Mux %d, Sending %+v\n", m.ID, msg)
    	}
    	gridLogIf(m.ctx, m.parent.queueMsg(msg, nil))
    }
    
    func (m *muxServer) close() {
    	m.cancel()
    	m.recvMu.Lock()
    	defer m.recvMu.Unlock()
    
    	if m.inbound != nil {
    		xioutil.SafeClose(m.inbound)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  10. internal/logger/targets.go

    func SystemTargets() []Target {
    	swapSystemMuRW.RLock()
    	defer swapSystemMuRW.RUnlock()
    
    	res := systemTargets
    	return res
    }
    
    // AuditTargets returns active audit targets.
    // Returned slice may not be modified in any way.
    func AuditTargets() []Target {
    	swapAuditMuRW.RLock()
    	defer swapAuditMuRW.RUnlock()
    
    	res := auditTargets
    	return res
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Apr 02 22:56:14 GMT 2024
    - 6.1K bytes
    - Viewed (0)
Back to top