Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 636 for rlocked (0.26 sec)

  1. src/sync/rwmutex_test.go

    	var wl RWMutex
    	var rl Locker
    	wlocked := make(chan bool, 1)
    	rlocked := make(chan bool, 1)
    	rl = wl.RLocker()
    	n := 10
    	go func() {
    		for i := 0; i < n; i++ {
    			rl.Lock()
    			rl.Lock()
    			rlocked <- true
    			wl.Lock()
    			wlocked <- true
    		}
    	}()
    	for i := 0; i < n; i++ {
    		<-rlocked
    		rl.Unlock()
    		select {
    		case <-wlocked:
    			t.Fatal("RLocker() didn't read-lock it")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 29 17:13:13 UTC 2021
    - 4.9K bytes
    - Viewed (0)
  2. internal/lsync/lrwmutex_test.go

    	wl := NewLRWMutex()
    	var rl sync.Locker
    	wlocked := make(chan bool, 1)
    	rlocked := make(chan bool, 1)
    	rl = wl.DRLocker()
    	n := 10
    	go func() {
    		for i := 0; i < n; i++ {
    			rl.Lock()
    			rl.Lock()
    			rlocked <- true
    			wl.Lock()
    			wlocked <- true
    		}
    	}()
    	for i := 0; i < n; i++ {
    		<-rlocked
    		rl.Unlock()
    		select {
    		case <-wlocked:
    			t.Fatal("RLocker() didn't read-lock it")
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Mar 05 04:57:35 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  3. internal/lock/lock.go

    // open file descriptor.
    package lock
    
    import (
    	"errors"
    	"os"
    	"sync"
    )
    
    // ErrAlreadyLocked is returned if the underlying fd is already locked.
    var ErrAlreadyLocked = errors.New("file already locked")
    
    // RLockedFile represents a read locked file, implements a special
    // closer which only closes the associated *os.File when the ref count.
    // has reached zero, i.e when all the readers have given up their locks.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 2.5K bytes
    - Viewed (0)
  4. cmd/local-locker_test.go

    	}
    	// A UID is added for every resource.
    	// We removed Add Rlocked entries
    	if len(l.lockUID) != len(wResources)*m {
    		t.Fatalf("lockUID len, got %d, want %d + %d", len(l.lockUID), 0, len(wResources)*m)
    	}
    
    	// Remove write locked
    	for i, names := range wResources {
    		arg := dsync.LockArgs{
    			UID:       wUIDs[i],
    			Resources: names[:],
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Mar 05 04:57:35 UTC 2023
    - 11.8K bytes
    - Viewed (0)
  5. pkg/kubelet/cm/dra/claiminfo_test.go

    		wantErr     bool
    	}{
    		{
    			description: "RLock-ed cache allows another RLock",
    			funcGen: func(cache *claimInfoCache) func() error {
    				return func() error {
    					if !cache.RWMutex.TryRLock() {
    						return errors.New("RLock failed")
    					}
    					return nil
    				}
    			},
    		},
    		{
    			description: "cache is locked inside a function",
    			funcGen: func(cache *claimInfoCache) func() error {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri May 03 13:30:31 UTC 2024
    - 21K bytes
    - Viewed (0)
  6. src/sync/rwmutex.go

    	return r < 0 && r+rwmutexMaxReaders > 0
    }
    
    // RLocker returns a [Locker] interface that implements
    // the [RWMutex.Lock] and [RWMutex.Unlock] methods by calling rw.RLock and rw.RUnlock.
    func (rw *RWMutex) RLocker() Locker {
    	return (*rlocker)(rw)
    }
    
    type rlocker RWMutex
    
    func (r *rlocker) Lock()   { (*RWMutex)(r).RLock() }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  7. src/runtime/lock_sema.go

    			for semasleep(ns) < 0 {
    				asmcgocall(*cgo_yield, nil)
    			}
    		}
    		gp.m.blocked = false
    		return true
    	}
    
    	deadline = nanotime() + ns
    	for {
    		// Registered. Sleep.
    		gp.m.blocked = true
    		if *cgo_yield != nil && ns > 10e6 {
    			ns = 10e6
    		}
    		if semasleep(ns) >= 0 {
    			gp.m.blocked = false
    			// Acquired semaphore, semawakeup unregistered us.
    			// Done.
    			return true
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  8. internal/dsync/drwmutex_test.go

    	expected := true
    	if locked != expected {
    		t.Errorf("TestSimpleWriteLockAcquired(): \nexpected %#v\ngot      %#v", expected, locked)
    	}
    }
    
    func TestSimpleWriteLockTimedOut(t *testing.T) {
    	locked := testSimpleWriteLock(t, testDrwMutexAcquireTimeout)
    
    	expected := false
    	if locked != expected {
    		t.Errorf("TestSimpleWriteLockTimedOut(): \nexpected %#v\ngot      %#v", expected, locked)
    	}
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sat Dec 24 03:49:07 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  9. internal/lsync/lrwmutex.go

    				unlocked = true
    			}
    		}
    	}
    
    	return unlocked
    }
    
    // ForceUnlock will forcefully clear a write or read lock.
    func (lm *LRWMutex) ForceUnlock() {
    	lm.mu.Lock()
    	defer lm.mu.Unlock()
    
    	lm.ref = 0
    	lm.isWriteLock = false
    }
    
    // DRLocker returns a sync.Locker interface that implements
    // the Lock and Unlock methods by calling drw.RLock and drw.RUnlock.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Sun Jan 02 17:15:06 UTC 2022
    - 4.8K bytes
    - Viewed (0)
  10. src/runtime/coro.go

    		casgstatus(gnext, _Gwaiting, _Grunnable)
    		casgstatus(gnext, _Grunnable, _Grunning)
    	}
    
    	// Donate locked state.
    	if locked {
    		mp.lockedg.set(gnext)
    		gnext.lockedm.set(mp)
    	}
    
    	// Release the trace locker. We've completed all the necessary transitions..
    	if trace.ok() {
    		traceRelease(trace)
    	}
    
    	// Switch to gnext. Does not return.
    	gogo(&gnext.sched)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 19:09:18 UTC 2024
    - 7.4K bytes
    - Viewed (0)
Back to top