Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 79 for Unlock (0.38 sec)

  1. internal/lock/lock.go

    	*LockedFile
    	mutex sync.Mutex
    	refs  int // Holds read lock refs.
    }
    
    // IsClosed - Check if the rlocked file is already closed.
    func (r *RLockedFile) IsClosed() bool {
    	r.mutex.Lock()
    	defer r.mutex.Unlock()
    	return r.refs == 0
    }
    
    // IncLockRef - is used by called to indicate lock refs.
    func (r *RLockedFile) IncLockRef() {
    	r.mutex.Lock()
    	r.refs++
    	r.mutex.Unlock()
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  2. 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 May 05 19:28:20 GMT 2024
    - Last Modified: Tue Apr 02 22:56:14 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  3. cmd/untar.go

    	r  io.Reader
    	mu sync.Mutex
    }
    
    func (d *disconnectReader) Read(p []byte) (n int, err error) {
    	d.mu.Lock()
    	defer d.mu.Unlock()
    	if d.r != nil {
    		return d.r.Read(p)
    	}
    	return 0, errors.New("reader closed")
    }
    
    func (d *disconnectReader) Close() error {
    	d.mu.Lock()
    	d.r = nil
    	d.mu.Unlock()
    	return nil
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6K bytes
    - Viewed (0)
  4. internal/dsync/locked_rand.go

    func (r *lockedRandSource) Int63() (n int64) {
    	r.lk.Lock()
    	n = r.src.Int63()
    	r.lk.Unlock()
    	return
    }
    
    // Seed uses the provided seed value to initialize the generator to a
    // deterministic state.
    func (r *lockedRandSource) Seed(seed int64) {
    	r.lk.Lock()
    	r.src.Seed(seed)
    	r.lk.Unlock()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Mon Oct 18 15:39:59 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  5. internal/http/server.go

    func (srv *Server) Shutdown() error {
    	srv.listenerMutex.Lock()
    	if srv.listener == nil {
    		srv.listenerMutex.Unlock()
    		return http.ErrServerClosed
    	}
    	srv.listenerMutex.Unlock()
    
    	if atomic.AddUint32(&srv.inShutdown, 1) > 1 {
    		// shutdown in progress
    		return http.ErrServerClosed
    	}
    
    	// Close underneath HTTP listener.
    	srv.listenerMutex.Lock()
    	err := srv.listener.Close()
    	srv.listenerMutex.Unlock()
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Feb 09 21:25:16 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  6. internal/config/lambda/event/targetlist.go

    }
    
    // Empty returns true if targetList is empty.
    func (list *TargetList) Empty() bool {
    	list.RLock()
    	defer list.RUnlock()
    
    	return len(list.targets) == 0
    }
    
    // List - returns available target IDs.
    func (list *TargetList) List(region string) []ARN {
    	list.RLock()
    	defer list.RUnlock()
    
    	keys := make([]ARN, 0, len(list.targets))
    	for k := range list.targets {
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue Mar 07 16:12:41 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  7. internal/once/init.go

    // 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
    		atomic.StoreUint32(&l.done, 1)
    	}
    	return nil
    }
    
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Tue May 09 04:20:31 GMT 2023
    - 2.1K bytes
    - Viewed (0)
  8. cmd/tier-journal.go

    	// Open journal if it hasn't been
    	err := jd.Open()
    	if err != nil {
    		return err
    	}
    
    	b, err := je.MarshalMsg(nil)
    	if err != nil {
    		return err
    	}
    
    	jd.Lock()
    	defer jd.Unlock()
    	_, err = jd.file.Write(b)
    	if err != nil {
    		// Do not leak fd here, close the file properly.
    		Fdatasync(jd.file)
    		_ = jd.file.Close()
    
    Go
    - Registered: Sun Feb 25 19:28:16 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 7.4K bytes
    - Viewed (0)
  9. internal/config/identity/openid/provider/keycloak.go

    	if err != nil {
    		return err
    	}
    	defer resp.Body.Close()
    
    	var accessToken Token
    	if err = json.NewDecoder(resp.Body).Decode(&accessToken); err != nil {
    		return err
    	}
    
    	k.Lock()
    	k.accessToken = accessToken
    	k.Unlock()
    	return nil
    }
    
    // LookupUser lookup user by their userid.
    func (k *KeycloakProvider) LookupUser(userid string) (User, error) {
    	req, err := http.NewRequest(http.MethodGet, k.adminURL, nil)
    Go
    - Registered: Sun May 05 19:28:20 GMT 2024
    - Last Modified: Fri Apr 29 01:27:09 GMT 2022
    - 4.6K bytes
    - Viewed (0)
  10. 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 May 05 19:28:20 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 4.8K bytes
    - Viewed (0)
Back to top