Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 13 for LoadUint32 (0.21 sec)

  1. internal/once/init.go

    // call to the function. ie, it invokes the function
    // if it is not successful yet.
    func (l *Init) Do(f func() error) error {
    	if atomic.LoadUint32(&l.done) == 0 {
    		return l.do(f)
    	}
    	return nil
    }
    
    func (l *Init) do(f func() error) error {
    	l.m.Lock()
    	defer l.m.Unlock()
    	if atomic.LoadUint32(&l.done) == 0 {
    		if err := f(); err != nil {
    			return err
    		}
    		// Mark as done only when f() is successful
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue May 09 04:20:31 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  2. internal/s3select/simdj/reader.go

    type safeCloser struct {
    	closed uint32
    	r      io.Reader
    }
    
    func (s *safeCloser) Read(p []byte) (n int, err error) {
    	if atomic.LoadUint32(&s.closed) == 1 {
    		return 0, io.EOF
    	}
    	n, err = s.r.Read(p)
    	if atomic.LoadUint32(&s.closed) == 1 {
    		return 0, io.EOF
    	}
    	return n, err
    }
    
    func (s *safeCloser) Close() error {
    	atomic.CompareAndSwapUint32(&s.closed, 0, 1)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue May 30 17:02:22 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  3. internal/config/lambda/target/lazyinit.go

    type lazyInit struct {
    	done uint32
    	m    sync.Mutex
    }
    
    func (l *lazyInit) Do(f func() error) error {
    	if atomic.LoadUint32(&l.done) == 0 {
    		return l.doSlow(f)
    	}
    	return nil
    }
    
    func (l *lazyInit) doSlow(f func() error) error {
    	l.m.Lock()
    	defer l.m.Unlock()
    	if atomic.LoadUint32(&l.done) == 0 {
    		if err := f(); err != nil {
    			return err
    		}
    		// Mark as done only when f() is successful
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Tue Mar 07 16:12:41 GMT 2023
    - 1.3K bytes
    - Viewed (0)
  4. internal/grid/connection.go

    	if debugPrint {
    		fmt.Println(c.Local, "->", c.Remote, "WaitForConnect")
    		defer fmt.Println(c.Local, "->", c.Remote, "WaitForConnect done")
    	}
    	c.connChange.L.Lock()
    	if atomic.LoadUint32((*uint32)(&c.state)) == StateConnected {
    		c.connChange.L.Unlock()
    		// Happy path.
    		return nil
    	}
    	ctx, cancel := context.WithCancel(ctx)
    	defer cancel()
    	changed := make(chan State, 1)
    	go func() {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 42.6K bytes
    - Viewed (0)
  5. internal/http/server.go

    	// * return 503 (service unavailable) if the server in shutdown.
    	wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
    		// If server is in shutdown.
    		if atomic.LoadUint32(&srv.inShutdown) != 0 {
    			// To indicate disable keep-alive, server is shutting down.
    			w.Header().Set("Connection", "close")
    
    			// Add 1 minute retry header, incase-client wants to honor it
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 09 21:25:16 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  6. internal/pubsub/pubsub.go

    	types := Mask(atomic.LoadUint64(&ps.types))
    	if !types.Overlaps(Mask(mask.Mask())) {
    		return 0
    	}
    	return atomic.LoadInt32(&ps.numSubscribers)
    }
    
    // Subscribers returns the number of current subscribers for all types.
    func (ps *PubSub[T, M]) Subscribers() int32 {
    	return atomic.LoadInt32(&ps.numSubscribers)
    }
    
    // New inits a PubSub system with a limit of maximum
    // subscribers unless zero is specified
    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)
  7. cmd/http-stats.go

    	totalS34xxErrors        HTTPAPIStats
    	totalS35xxErrors        HTTPAPIStats
    	totalS3Canceled         HTTPAPIStats
    }
    
    func (st *HTTPStats) loadRequestsInQueue() int32 {
    	return atomic.LoadInt32(&st.s3RequestsInQueue)
    }
    
    func (st *HTTPStats) addRequestsInQueue(i int32) {
    	atomic.AddInt32(&st.s3RequestsInQueue, i)
    }
    
    func (st *HTTPStats) incS3RequestsIncoming() {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Mar 10 09:15:15 GMT 2024
    - 11.4K bytes
    - Viewed (0)
  8. internal/logger/target/http/http.go

    }
    
    func (h *Target) String() string {
    	return h.config.Name
    }
    
    // IsOnline returns true if the target is reachable using a cached value
    func (h *Target) IsOnline(ctx context.Context) bool {
    	return atomic.LoadInt32(&h.status) == statusOnline
    }
    
    // Stats returns the target statistics.
    func (h *Target) Stats() types.TargetStats {
    	h.logChMu.RLock()
    	queueLength := len(h.logCh)
    	h.logChMu.RUnlock()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Mar 25 16:44:20 GMT 2024
    - 14.9K bytes
    - Viewed (0)
  9. internal/rest/client.go

    		// make connection pre-emptively.
    		go clnt.HealthCheckFn()
    	}
    	return clnt
    }
    
    // IsOnline returns whether the client is likely to be online.
    func (c *Client) IsOnline() bool {
    	return atomic.LoadInt32(&c.connected) == online
    }
    
    // LastConn returns when the disk was (re-)connected
    func (c *Client) LastConn() time.Time {
    	return time.Unix(0, atomic.LoadInt64(&c.lastConn))
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 14K bytes
    - Viewed (0)
  10. internal/logger/target/kafka/kafka.go

    		atomic.StoreInt32(&h.status, statusOnline)
    	}
    
    	return nil
    }
    
    // IsOnline returns true if the target is online.
    func (h *Target) IsOnline(_ context.Context) bool {
    	return atomic.LoadInt32(&h.status) == statusOnline
    }
    
    // Send log message 'e' to kafka target.
    func (h *Target) Send(ctx context.Context, entry interface{}) error {
    	if h.store != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 10.1K bytes
    - Viewed (1)
Back to top