Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for ForgetUnshared (0.28 sec)

  1. src/internal/singleflight/singleflight_test.go

    	resultCh := g.DoChan(key, func() (i interface{}, e error) {
    		panic("third must not be started")
    	})
    
    	if g.ForgetUnshared(key) {
    		t.Errorf("Before first goroutine finished, key %q is shared, should return false", key)
    	}
    
    	close(firstCh)
    	firstFinished.Wait()
    
    	if g.ForgetUnshared(key) {
    		t.Errorf("After first goroutine finished, key %q is still shared, should return false", key)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 29 22:21:50 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  2. src/internal/singleflight/singleflight.go

    	g.mu.Lock()
    	c.wg.Done()
    	if g.m[key] == c {
    		delete(g.m, key)
    	}
    	for _, ch := range c.chans {
    		ch <- Result{c.val, c.err, c.dups > 0}
    	}
    	g.mu.Unlock()
    }
    
    // ForgetUnshared tells the singleflight to forget about a key if it is not
    // shared with any other goroutines. Future calls to Do for a forgotten key
    // will call the function rather than waiting for an earlier call to complete.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 30 20:49:56 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  3. src/net/lookup.go

    		// If there are other goroutines looking up this key,
    		// let the lookup continue uncanceled, and let later
    		// lookups with the same key share the result.
    		// See issues 8602, 20703, 22724.
    		if r.getLookupGroup().ForgetUnshared(lookupKey) {
    			lookupGroupCancel()
    			go dnsWaitGroupDone(ch, func() {})
    		} else {
    			go dnsWaitGroupDone(ch, lookupGroupCancel)
    		}
    		err := newDNSError(mapErr(ctx.Err()), host, "")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:23:45 UTC 2024
    - 28.6K bytes
    - Viewed (0)
Back to top