Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 54 for addUint32 (0.34 sec)

  1. internal/http/server.go

    			w.Header().Set(RetryAfter, "60")
    
    			w.WriteHeader(http.StatusServiceUnavailable)
    			w.Write([]byte(http.ErrServerClosed.Error()))
    			return
    		}
    
    		atomic.AddInt32(&srv.requestCount, 1)
    		defer atomic.AddInt32(&srv.requestCount, -1)
    
    		// Handle request using passed handler.
    		handler.ServeHTTP(w, r)
    	})
    
    	srv.listenerMutex.Lock()
    	srv.Handler = wrappedHandler
    	srv.listener = listener
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Feb 09 21:25:16 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  2. src/runtime/race/race_test.go

    	)
    	var wg sync.WaitGroup
    	wg.Add(G)
    	for g := 0; g < G; g++ {
    		go func() {
    			defer wg.Done()
    			hold := make([][]uint32, H)
    			for i := 0; i < b.N; i++ {
    				a := make([]uint32, S)
    				atomic.AddUint32(&a[rand.Intn(len(a))], 1)
    				hold[rand.Intn(len(hold))] = a
    			}
    			_ = hold
    		}()
    	}
    	wg.Wait()
    }
    
    func BenchmarkStackLeak(b *testing.B) {
    	done := make(chan bool, 1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 6K bytes
    - Viewed (0)
  3. src/sync/atomic/type.go

    // Add atomically adds delta to x and returns the new value.
    func (x *Uint32) Add(delta uint32) (new uint32) { return AddUint32(&x.v, delta) }
    
    // And atomically performs a bitwise AND operation on x using the bitmask
    // provided as mask and returns the old value.
    func (x *Uint32) And(mask uint32) (old uint32) { return AndUint32(&x.v, mask) }
    
    // Or atomically performs a bitwise OR operation on x using the bitmask
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:37:29 UTC 2024
    - 8.5K bytes
    - Viewed (0)
  4. src/sync/pool_test.go

    		if try == 1 && testing.Short() {
    			break
    		}
    		var fin, fin1 uint32
    		for i := 0; i < N; i++ {
    			v := new(string)
    			runtime.SetFinalizer(v, func(vv *string) {
    				atomic.AddUint32(&fin, 1)
    			})
    			p.Put(v)
    		}
    		if drain {
    			for i := 0; i < N; i++ {
    				p.Get()
    			}
    		}
    		for i := 0; i < 5; i++ {
    			runtime.GC()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8K bytes
    - Viewed (0)
  5. src/cmd/link/internal/loong64/asm.go

    	"debug/elf"
    	"log"
    )
    
    func gentext(ctxt *ld.Link, ldr *loader.Loader) {
    	initfunc, addmoduledata := ld.PrepareAddmoduledata(ctxt)
    	if initfunc == nil {
    		return
    	}
    
    	o := func(op uint32) {
    		initfunc.AddUint32(ctxt.Arch, op)
    	}
    
    	// Emit the following function:
    	//
    	//	local.dso_init:
    	//		la.pcrel $a0, local.moduledata
    	//		b runtime.addmoduledata
    
    	//	0000000000000000 <local.dso_init>:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 17:26:07 UTC 2024
    - 7.5K bytes
    - Viewed (0)
  6. src/sync/map_test.go

    	// Set finalizers that count for collected keys. A non-zero count
    	// indicates that keys have not been leaked.
    	for atomic.LoadUint32(&finalized) == 0 {
    		p := new(int)
    		runtime.SetFinalizer(p, func(*int) {
    			atomic.AddUint32(&finalized, 1)
    		})
    		m.Store(p, struct{}{})
    		m.Delete(p)
    		runtime.GC()
    	}
    }
    
    func TestMapRangeNestedCall(t *testing.T) { // Issue 46399
    	var m sync.Map
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  7. src/runtime/rwmutex_test.go

    func reader(rwm *RWMutex, num_iterations int, activity *int32, cdone chan bool) {
    	for i := 0; i < num_iterations; i++ {
    		rwm.RLock()
    		n := atomic.AddInt32(activity, 1)
    		if n < 1 || n >= 10000 {
    			panic(fmt.Sprintf("wlock(%d)\n", n))
    		}
    		for i := 0; i < 100; i++ {
    		}
    		atomic.AddInt32(activity, -1)
    		rwm.RUnlock()
    	}
    	cdone <- true
    }
    
    func writer(rwm *RWMutex, num_iterations int, activity *int32, cdone chan bool) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 22:00:45 UTC 2023
    - 4.2K bytes
    - Viewed (0)
  8. internal/pubsub/pubsub.go

    func (ps *PubSub[T, M]) Subscribe(mask M, subCh chan T, doneCh <-chan struct{}, filter func(entry T) bool) error {
    	totalSubs := atomic.AddInt32(&ps.numSubscribers, 1)
    	if ps.maxSubscribers > 0 && totalSubs > ps.maxSubscribers {
    		atomic.AddInt32(&ps.numSubscribers, -1)
    		return fmt.Errorf("the limit of `%d` subscribers is reached", ps.maxSubscribers)
    	}
    	ps.Lock()
    	defer ps.Unlock()
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Feb 06 16:57:30 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  9. src/cmd/go/internal/par/work_test.go

    package par
    
    import (
    	"sync/atomic"
    	"testing"
    	"time"
    )
    
    func TestWork(t *testing.T) {
    	var w Work[int]
    
    	const N = 10000
    	n := int32(0)
    	w.Add(N)
    	w.Do(100, func(i int) {
    		atomic.AddInt32(&n, 1)
    		if i >= 2 {
    			w.Add(i - 1)
    			w.Add(i - 2)
    		}
    		w.Add(i >> 1)
    		w.Add((i >> 1) ^ 1)
    	})
    	if n != N+1 {
    		t.Fatalf("ran %d items, expected %d", n, N+1)
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 03 09:56:24 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  10. internal/lsync/lrwmutex_test.go

    	for i := 0; i < numIterations; i++ {
    		if rwm.GetRLock(context.Background(), "", "", time.Second) {
    			n := atomic.AddInt32(activity, 1)
    			if n < 1 || n >= 10000 {
    				panic(fmt.Sprintf("wlock(%d)\n", n))
    			}
    			for i := 0; i < 100; i++ {
    			}
    			atomic.AddInt32(activity, -1)
    			rwm.RUnlock()
    		}
    	}
    	cdone <- true
    }
    
    // Borrowed from rwmutex_test.go
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Mar 05 04:57:35 UTC 2023
    - 7.9K bytes
    - Viewed (0)
Back to top